Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Switch active_model to use I18n.translate method instead

#1183

Usually, when I run the application I keep getting an error in my log about deprecation of ActiveRecord::Errors.default_error_messages. So, I tracked out the error, and found out that ActiveModel was the one that actually raise this error.

So, I patched the files that referenced to ActiveRecord::Errors.default_error_messages, and hopefully this will be patched in the main branch.

Reported by Prem Sichanugrist (sikachu) · October 7th, 2008 @ 11:14 AM

State: committed
Milestone: 3.0.2
Assigned to: josh josh
Importance: none

Activity

  1. Pratik
    Pratik
    • Milestone cleared.
    • Tag changed from 2.2, activemodel, bug, errors, i18n, patch to 2.2, activemodel, bug, errors, i18n, patch
    • Assigned user set to Sven Fuchs

    January 18th, 2009 @ 05:57 AM

  2. Pratik
  3. Kieran P
    Kieran P

    +1

    Got this in the logs. Using Rails 2.3 RC1:

    DEPRECATION WARNING: ActiveRecord::Errors.default_error_messages has been deprecated. Please use I18n.translate('activerecord.errors.messages').. (called from default_error_messages at /Users/kieran/Work/kete_trunk/vendor/rails/activerecord/lib/active_record/validations.rb:24)

    February 16th, 2009 @ 03:59 AM

  4. Sven Fuchs
    Sven Fuchs

    I think Rick is working on this. Rick, will you take over the ticket?

    February 16th, 2009 @ 10:18 AM

  5. CancelProfileIsBroken
    CancelProfileIsBroken
    • Assigned user changed from Sven Fuchs to Rick
    • Milestone set to 2.x

    April 22nd, 2009 @ 10:21 PM

  6. Kieran P
    Kieran P

    This problem is still present in Rails 2.3.3, and makes test output very cluttered. Any progress with fixing it?

    August 7th, 2009 @ 11:50 AM

  7. josh
    josh
    • Assigned user changed from Rick to josh
    • Tag changed from 2.2, activemodel, bug, errors, i18n, patch to activemodel, bug, bugmash, errors, i18n
    • State changed from new to open
    • Milestone cleared.

    Needs to be rebased against 3.0. AMo doesn't matter for 2.3.3 since the gem was never released.

    August 10th, 2009 @ 02:36 AM

  8. Kieran P
    Kieran P

    Well there might be something causing it elsewhere, cause I get the deprecation warning on Rails 2.3.3.

    August 10th, 2009 @ 03:48 AM

  9. Dan Croak
    Dan Croak

    +1 verified patch applies if the second commit regarding I18n is deleted.

    I believe the second commit is unnecessary because Edge Rails now elegantly handles #translate here:

    lib/active_model/errors.rb
    158: I18n.translate(key, options)

    I have attached a patch that is Sikachu!'s patch with the second commit removed. Should be good now in master with git apply.

    August 10th, 2009 @ 04:03 AM

  10. Repository
    Repository
    • State changed from open to committed

    (from [82dd725fc195eb52eea9cbde9530ab9dff122e32]) Fix that irregular plural inflections should not be double-pluralized: 'people'.pluralize should return 'people' not 'peoples'.

    [#1183 Switch active_model to use I18n.translate method instead state:committed]

    Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
    http://github.com/rails/rails/commit/82dd725fc195eb52eea9cbde9530ab...

    August 10th, 2009 @ 04:31 AM

  11. Jeremy Kemper
    Jeremy Kemper
    • Tag changed from activemodel, bug, bugmash, errors, i18n to activemodel, bug, errors, i18n

    August 10th, 2009 @ 04:32 AM

  12. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)

    Thank you Dan Croak for modified my patch. Actually it was my mistake that I made two commits into one change file. I posted a ticket to fix the bug about pluralize here:

    #549 Fix inflector bug on pluralize the irregular words

    I think that ticket should be changed from stale to fixed then :)

    Thank you ;)

    August 10th, 2009 @ 09:15 AM

  13. Jeremy Kemper