Skip to content

Commit

Permalink
Fix for #5
Browse files Browse the repository at this point in the history
  • Loading branch information
ClickerMonkey committed Oct 4, 2016
1 parent 3a19283 commit 343332f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rekord-validation",
"version": "1.4.0",
"version": "1.4.1",
"homepage": "https://github.com/Rekord/rekord-validation",
"authors": [
"Philip Diffenderfer <[email protected]>"
Expand Down
6 changes: 4 additions & 2 deletions build/rekord-validation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* rekord-validation 1.4.0 - Advanced validation rules for rekord by Philip Diffenderfer */
/* rekord-validation 1.4.1 - Advanced validation rules for rekord by Philip Diffenderfer */
(function(global, Rekord, undefined)
{
var Model = Rekord.Model;
Expand Down Expand Up @@ -1278,9 +1278,11 @@ function subRuleGenerator(ruleName, isInvalid)
}
};

var testValue = otherField === field ? value : model.$get( otherField );

for (var i = 0; i < validators.length; i++)
{
validators[ i ]( value, model, setInvalid );
validators[ i ]( testValue, model, setInvalid );
}

return isInvalid( invalids, validators.length ) ? Validation.Stop : value;
Expand Down
4 changes: 2 additions & 2 deletions build/rekord-validation.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/rekord-validation.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rekord-validation",
"version": "1.4.0",
"version": "1.4.1",
"description": "Advanced validation rules for rekord",
"author": "Philip Diffenderfer",
"license": "MIT",
Expand Down
4 changes: 3 additions & 1 deletion src/lib/rules/if.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ function subRuleGenerator(ruleName, isInvalid)
}
};

var testValue = otherField === field ? value : model.$get( otherField );

for (var i = 0; i < validators.length; i++)
{
validators[ i ]( value, model, setInvalid );
validators[ i ]( testValue, model, setInvalid );
}

return isInvalid( invalids, validators.length ) ? Validation.Stop : value;
Expand Down

0 comments on commit 343332f

Please sign in to comment.