backbone.validations icon indicating copy to clipboard operation
backbone.validations copied to clipboard

Required validator issues

Open jaycetde opened this issue 12 years ago • 0 comments

A model with two required attributes throws an error if both aren't being set every time. The latest commit (https://github.com/n-time/backbone.validations/commit/96a9c3b01d73ab2869b47679b60348b507ba04ac) broke this. example:

var x = Backbone.Model.extend({ validate: { firstName: { required: true }, lastName: { required: true } } });

var y = new x({ firstName: 'John', lastName: 'Doe' });

y.on('error', function (model, err) { console.log(err); });

y.set('firstName', 'Jane'); // Error -> lastName -> required

jaycetde avatar Dec 03 '12 19:12 jaycetde