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

Use standart ActiveRecord error message for email uniqueness validation #746

Conversation

mpugach
Copy link
Contributor

@mpugach mpugach commented Oct 5, 2016

According to the Rails Guides there already is a localization for the uniqueness validation. And the key is :taken.

So if one wants to provide his own translation, he should redefine one of the keys in the following order:

activerecord.errors.models.user.attributes.email.taken
activerecord.errors.models.user.taken
activerecord.errors.messages.taken
errors.attributes.email.taken
errors.messages.taken

@booleanbetrayal
Copy link
Collaborator

LGTM!

@booleanbetrayal booleanbetrayal merged commit 123cfb7 into lynndylanhurley:master Oct 6, 2016
@booleanbetrayal
Copy link
Collaborator

thanks @mpugach

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