isValid now takes an optional 'options' parameter that gets passed through to validate. Needed so one can test validation under a variety of contexts

This commit is contained in:
Evan Morikawa
2012-06-23 17:28:19 -04:00
parent cf805816e2
commit 66a79f1496

View File

@@ -519,8 +519,9 @@
// Check if the model is currently in a valid state. It's only possible to
// get into an *invalid* state if you're using silent changes.
isValid: function() {
return !this.validate || !this.validate(this.attributes);
isValid: function(options) {
options || (options = {});
return !this.validate || !this.validate(this.attributes, options);
},
// Run validation against the next complete set of model attributes,