mirror of
https://github.com/jashkenas/backbone.git
synced 2026-01-23 05:48:10 -05:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user