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

[BUG] mongoid model error validations not working #619

Closed
pnock opened this issue Feb 9, 2022 · 3 comments
Closed

[BUG] mongoid model error validations not working #619

pnock opened this issue Feb 9, 2022 · 3 comments
Milestone

Comments

@pnock
Copy link

pnock commented Feb 9, 2022

What I tried to do

We have things like this in our yml file for validation messages:

en:
  errors:
    messages:
      taken: "Message 1"
  mongoid:
    errors:
      models:
        user:
          attributes:
            name:
              blank: ...
              taken: "Message 2"

What I expected to happen

Until V1.9.1, the "taken" validation error for our user model was "Message 2".

What actually happened

It doesn't seem to recognize the model specific validation messages, and we get "Message 1" instead.

Versions of i18n, rails, and anything else you think is necessary

This changed after updating i18n gem from 1.8.11 to 1.9.1

@radar
Copy link
Collaborator

radar commented Feb 9, 2022

I think this might be related to #617, possibly.

@pnock pnock changed the title [BUG] [BUG] mongoid model error validations not working Feb 10, 2022
@radar radar added this to the 1.10 milestone Feb 14, 2022
@radar
Copy link
Collaborator

radar commented Feb 14, 2022

I18n 1.10.0 has just been released, and I think it'll fix this problem. Please let me know if it doesn't.

@radar radar closed this as completed Feb 14, 2022
@pnock
Copy link
Author

pnock commented Feb 15, 2022

I18n 1.10.0 has just been released, and I think it'll fix this problem. Please let me know if it doesn't.

Yes, our tests are passing now. Thanks for the update.

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

No branches or pull requests

2 participants