Permalink
Browse files

Move the ‘except’ attribute into a separate file

  • Loading branch information...
Baggz committed Mar 12, 2012
1 parent 3cabc0c commit c2ea390f5f7c3c8a278e4f6c6a52bd972f75c6e9
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/engines/json/attributes/except.js
@@ -0,0 +1,14 @@
+/**
+ * Except
+ */
+Validation.prototype.addAttributeConstructor('except', function exceptConstructor() {
+ return function except(property, propertyValue, attributeValue, propertyAttributes, callback) {
+
+ if (attributeValue.indexOf(propertyValue) !== -1) {
+ this.addError('except', property);
+ }
+
+ return callback();
+
+ };
+});

0 comments on commit c2ea390

Please sign in to comment.