You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,13 +25,13 @@ const Validations = {
25
25
creditCardNumber:validateSometimes([
26
26
validatePresence(true),
27
27
validateNumber({ is:16 })
28
-
], function(changes) {
28
+
], function(changes, content) {
29
29
returnget(changes, 'paymentMethod.isCreditCard')
30
30
})
31
31
};
32
32
```
33
33
34
-
`validateSometimes` takes 2 arguments. The first is a list of validators and the second is a callback function which represents the condition. If the condition callback returns `true`, the rules will be added.
34
+
`validateSometimes` takes 2 arguments. The first is a list of validators. The second argument is a callback function which represents the condition. If the condition callback returns `true`, the rules will be added. This callback function will be invoked with the changeset's changes and content.
0 commit comments