Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Error methods should be chainable where possible.

  • Loading branch information...
commit bc7fee069508cd1c7e07a09078fabef735448347 1 parent 659aa09
@benpickles authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  src/model_errors.js
View
3  src/model_errors.js
@@ -7,6 +7,7 @@ Model.Errors.prototype = {
add: function(attribute, message) {
if (!this.errors[attribute]) this.errors[attribute] = [];
this.errors[attribute].push(message);
+ return this
},
all: function() {
@@ -15,6 +16,7 @@ Model.Errors.prototype = {
clear: function() {
this.errors = {};
+ return this
},
each: function(func) {
@@ -23,6 +25,7 @@ Model.Errors.prototype = {
func.call(this, attribute, this.errors[attribute][i]);
}
}
+ return this
},
on: function(attribute) {
Please sign in to comment.
Something went wrong with that request. Please try again.