Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

also pass data to beforeValidate hook, even when validation is not set

  • Loading branch information...
commit 950bc2ab6511d1f99abda0a4b5a431de3cd84070 1 parent 5fba357
@ktmud ktmud authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/validations.js
View
6 lib/validations.js
@@ -22,7 +22,7 @@ var Validatable = require('./model.js');
/**
* Validate presence. This validation fails when validated field is blank.
- *
+ *
* Default error message "can't be blank"
*
* @example presence of title
@@ -92,7 +92,7 @@ Validatable.validatesNumericalityOf = getConfigurator('numericality');
/**
* Validate inclusion in set
*
- * @example
+ * @example
* ```
* User.validatesInclusionOf('gender', {in: ['male', 'female']});
* User.validatesInclusionOf('role', {
@@ -351,7 +351,7 @@ Validatable.prototype.isValid = function (callback, data) {
validationsDone.call(inst, function() {
callback(valid);
});
- });
+ }, data);
}
return valid;
}
Please sign in to comment.
Something went wrong with that request. Please try again.