Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix #1179 - isValid returns true in the absence of validate.

  • Loading branch information...
commit 137b7fd670ae25141c6f5865797a0902476add6f 1 parent a2ed079
Brad Dunbar braddunbar authored
Showing with 7 additions and 1 deletion.
  1. +1 −1  backbone.js
  2. +6 −0 test/model.js
2  backbone.js
View
@@ -529,7 +529,7 @@
// 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.attributes);
+ return !this.validate || !this.validate(this.attributes);
},
// Run validation against the next complete set of model attributes,
6 test/model.js
View
@@ -784,4 +784,10 @@ $(document).ready(function() {
}
});
+ test("#1179 - isValid returns true in the absence of validate.", function() {
+ var model = new Backbone.Model();
+ model.validate = null;
+ ok(model.isValid());
+ });
+
});
Please sign in to comment.
Something went wrong with that request. Please try again.