Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change the way the ‘minLength’ attribute reports errors

  • Loading branch information...
commit 7d9006310dfb4d1505a25908bd7044e45f911e8d 1 parent e10b82e
@Baggz authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/engines/json/attributes/minLength.js
View
12 src/engines/json/attributes/minLength.js
@@ -2,13 +2,13 @@
* MinLength
*/
Validation.prototype.addAttributeConstructor('minLength', function minLengthConstructor() {
-
return function minLength(property, propertyValue, attributeValue, propertyAttributes, callback) {
- if (isString(propertyValue) && propertyValue.length >= attributeValue) {
- return callback();
- } else {
- return callback(true);
+
+ if (isString(propertyValue) && propertyValue.length < attributeValue) {
+ this.addError();
}
- };
+ return callback();
+
+ };
});
Please sign in to comment.
Something went wrong with that request. Please try again.