Skip to content

Commit 6f6e61b

Browse files
author
David Tang
committed
README
1 parent c27d6b1 commit 6f6e61b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ const Validations = {
2626
validatePresence(true),
2727
validateNumber({ is: 16 })
2828
], function(changes, content) {
29-
return get(changes, 'paymentMethod.isCreditCard')
29+
return get(changes, 'paymentMethod.isCreditCard') || get(content, 'paymentMethod.isCreditCard');
3030
})
3131
};
3232
```
3333

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.
34+
`validateSometimes` takes 2 arguments. The first is a list of validators you want applied to the attribute. 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.
3535

3636
```js
3737
import Changeset from 'ember-changeset';

0 commit comments

Comments
 (0)