ruby-i18n / i18n

Internationalization (i18n) library for Ruby
MIT License
977 stars 408 forks source link

[BUG] mongoid model error validations not working #619

Closed pnock closed 2 years ago

pnock commented 2 years ago

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 commented 2 years ago

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

radar commented 2 years ago

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

pnock commented 2 years ago

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.