From 66a79f14968963f42fb3b5b7ea0bb7ac33fd96c2 Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Sat, 23 Jun 2012 17:28:19 -0400 Subject: [PATCH] isValid now takes an optional 'options' parameter that gets passed through to validate. Needed so one can test validation under a variety of contexts --- backbone.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backbone.js b/backbone.js index 16bd9661..b55df514 100644 --- a/backbone.js +++ b/backbone.js @@ -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,