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

I18n conflicts with Activemodel I18n #65

Closed
be9 opened this issue Jun 9, 2015 · 4 comments
Closed

I18n conflicts with Activemodel I18n #65

be9 opened this issue Jun 9, 2015 · 4 comments

Comments

@be9
Copy link

be9 commented Jun 9, 2015

ActiveModel contains own definition of errors.messages.equal_to, as seen in here. date_validator redefines it here which causes breakage. E.g. I get following in my specs:

    I18n::MissingInterpolationArgument:
       missing interpolation argument :date in "must be equal to %{date}" ({:model=>"Site", :attribute=>"Monthly payment", :value=>1.0, :count=>0} given)

ActiveModel variant is "must be equal to %{count}" and it works if date_validator is not loaded.

@dolzenko
Copy link

Same issue here, I assume date_validator should use namespaced errors?

As a temp fix I had to add this to my locale file:

en:
  activerecord:
    errors:
      messages:
        equal_to: "must be equal to %{count}"

@thibaudgg
Copy link

👍

@eebs
Copy link

eebs commented Feb 12, 2016

I have run into this problem as well. @dolzenko's fix worked for me as well, but I presume this would break date_validator's equal_to option message.

@mrcasals
Copy link
Contributor

Closed by #77

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

5 participants