-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alias validator #161
Alias validator #161
Conversation
assert.equal(user.get('validations.attrs.firstName.isValid'), false); | ||
assert.equal(user.get('validations.attrs.lastName.isValid'), false); | ||
assert.equal(user.get('validations.attrs.fullName.isValid'), false); | ||
assert.deepEqual(user.get('validations.attrs.fullName.messages').sort(), ['firstName should be present', 'lastName should be present'].sort()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice - i think this is the right behavior vs. firstObject
.
This LGTM cc @gustaff-weldon |
I feel like there will be a use-case where you might not want to |
I think the option is reasonable, or just documentation around |
@blimmer not sure I follow what you mean. |
Sorry, just reread my comment and it wasn't very clear. I was thinking that a |
Creates an alias between a single attribute's validations to another.
@blimmer Let me know what you think. I went kinda crazy and cleaned up some stuff.
The important files are:
addon/validations/factory.js
addon/validators/alias.js
tests/integration/validations/model-relationships-test.js
Resolves #160