Skip to content

Respect ActiveModel 'base' validations pattern #7

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

Merged
merged 1 commit into from
Sep 28, 2017

Conversation

wadetandy
Copy link
Contributor

It is a common pattern for activerecord and activemodel models to
indicate errors that are not on a given field but rather on the entire
model by adding an error to the "base" attribute. In this case the
message tends to be a complete sentence about the model state, rather
than a clause appended to the attribute name ("can't be blank"). In
this case, we don't want to append "Base" to the beginning of the error
message.

It is a common pattern for activerecord and activemodel models to
indicate errors that are not on a given field but rather on the entire
model by adding an error to the "base" attribute.  In this case the
message tends to be a complete sentence about the model state, rather
than a clause appended to the attribute name ("can't be blank").  In
this case, we don't want to append "Base" to the beginning of the error
message.
@richmolj richmolj merged commit 624646a into jsonapi-suite:master Sep 28, 2017
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