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.

Deprecation of old AR error message interpolation vars too greedy

#2885

I18n::Backend::Simple#interpolate_with_deprecated_syntax (part of ActiveRecord) makes old error messages (pre 2.2) still work with current ActiveRecord I18n. It's a bit too greedy though resulting in problems with Strings that are supposed to contain %d placeholders, like date formats.

The attached patch fixes that and makes #interpolate_with_deprecated_syntax only kick in when the user passed interpolation values to #t at all.

This should go into all upcoming 2.x versions as it's really a bug :) Afaik it doesn't need to go into 3.0 as the deprecation already has been entirely removed from that branch.

Reported by Sven Fuchs · July 8th, 2009 @ 06:03 PM

State: committed
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. mail (at arcasys)
    mail (at arcasys)

    Thanks, excellent, +1

    Hans

    July 9th, 2009 @ 09:38 AM

  2. Repository
    Repository
    • State changed from new to committed

    (from [bf00de03dee5fba0b53f0fc1bb19464422550aa9]) Stop messing with supposedly-deprecated interpolation placeholders when no interpolation values have been passed.

    [#2885 Deprecation of old AR error message interpolation vars too greedy state:committed]

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

    August 2nd, 2009 @ 04:51 AM

  3. Sven Fuchs