Skip to content
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

Validations configuration as object #259

Merged
merged 4 commits into from
Aug 31, 2014

Conversation

fabien
Copy link
Contributor

@fabien fabien commented Aug 26, 2014

Previously validations were appended to an array when configured. The format was cumbersome, and led to issues. This refactors the configuration into an object, as a property of the Model.

Note that if no validations have been configured, this property is currently undefined.

@raymondfeng any thoughts on having a getter for Model.validations that's always available, regardless of any configuration?

The new Validatable.validations mixin method returns the validations as
an object
indexed by property name.
Previously validations were appended to an array when configured. The
format was cumbersome, and led to issues. This refactors the
configuration into an object, as a property of the Model.

Note that if no validations have been configured, this property is
currently `undefined`.
Fixes loopbackio#154 - args should only contain the property name at that point,
not loop over it.
@fabien fabien mentioned this pull request Aug 26, 2014
raymondfeng added a commit that referenced this pull request Aug 31, 2014
Validations configuration as object
@raymondfeng raymondfeng merged commit 6527bd0 into loopbackio:master Aug 31, 2014
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants