This project is archived and is in readonly mode.

#6123 ✓stale
bug.odesk (at gmail)

Possible AR 3.1.0beta bug

Reported by bug.odesk (at gmail) | December 7th, 2010 @ 08:52 AM

Not completely sure if it rails bug or not, but still let me explain. I'm trying to use I18n::Backend::ActiveRecord with rails 3.1.0beta. My initializer:

I18n.backend = I18n::Backend::ActiveRecord.new

I18n::Backend::ActiveRecord.send(:include, I18n::Backend::Memoize)
I18n::Backend::Simple.send(:include, I18n::Backend::Memoize)
I18n::Backend::Simple.send(:include, I18n::Backend::Pluralization)
I18n::Backend::ActiveRecord.send(:include, I18n::Backend::Flatten)

I18n.backend = I18n::Backend::Chain.new(I18n::Backend::Simple.new, I18n.backend)

Everything works perfect, except one thing. AR backend using serialized attributes (value and interpolations) in I18n::Backend::ActiveRecord::Translation model. And weird thing - every models have serialized_attributes = {"value"=>Object, "interpolations"=>Array}. I can't figure out why it's set for every model. This breaks normal saving for those attributes in my models. On AR 3.0.3 everything ok.

Can you please check it?

Comments and changes to this ticket

  • bug.odesk (at gmail)

    bug.odesk (at gmail) December 7th, 2010 @ 09:10 AM

    I created test app: https://github.com/slbug/test_i18n

    just clone it, run migrations and check localhost:3000

    P.S. even without initializer (only with i18n-active_record gem in Gemfile) it shows same serialized attributes.

  • bug.odesk (at gmail)

    bug.odesk (at gmail) December 7th, 2010 @ 03:50 PM

    • Tag changed from activerecord, rails3.1 to activerecord, i18n, rails3, rails3.1, serialized
  • José Valim

    José Valim December 7th, 2010 @ 05:07 PM

    • Importance changed from “” to “Low”

    Seems like AR bug. Try running i18n-activerecord using 3.1.0 tests.

  • bug.odesk (at gmail)

    bug.odesk (at gmail) December 7th, 2010 @ 05:54 PM

    seems like i can't start tests. it fails on 1.9.2 because on rubytree gem and fails on 1.8.7 because of some error in rubyinline. will continue trying, but...

  • bug.odesk (at gmail)

    bug.odesk (at gmail) December 7th, 2010 @ 10:48 PM

    finally managed to run i18n-activerecord tests. all passes using 3.0.3 and 3.1.0

  • bug.odesk (at gmail)

    bug.odesk (at gmail) December 8th, 2010 @ 02:43 PM

    anything else i can do to help find problem?

  • rails

    rails March 9th, 2011 @ 12:00 AM

    • Tag changed from activerecord, i18n, rails3, rails3.1, serialized to activerecord, i18n, rails3, rails31, serialized
    • State changed from “new” to “open”

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • rails

    rails March 9th, 2011 @ 12:00 AM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages