grosser/gettext_i18n_rails — Issue #51: will paginate gem seems to override gettext_i18n_rails activerecord method
Author: 2potatocakes
Created: 2012-01-11 00:14:53+00:00
State: open

Just an FYI really, haven't looked into it properly yet, but if I have both will_paginate and gettext_i18n_rails initialised in my environment.rb file using Rails 2.3.14, ruby 1.8.7, the rake task store_model_attributes won't work.

I think will_paginate is monkey patching the method_missing method in ActiveRecord and this gets intercepted before gettext_i18n_rails gets to it.

Have just resorted to adding :lib => false in environment.rb to will_paginate while I run this rake task:

config.gem 'will_paginate', :lib => false, :version => '2.3.16'

Otherwise here's what I get:

writing model translations to: locale/model_attributes.rb
[Error] Attribute extraction failed. Removing incomplete file (locale/model_attributes.rb)
rake aborted!
undefined method `gettext_translation_for_attribute_name' for #
.../vendor/rails/activerecord/lib/active_record/base.rb:1998:in `method_missing_without_paginate'
.../vendor/gems/will_paginate-2.3.16/lib/will_paginate/finder.rb:170:in `method_missing'
.../vendor/gems/gettext_i18n_rails-0.4.0/lib/gettext_i18n_rails/model_attributes_finder.rb:20:in `store_model_attributes'
.../vendor/gems/gettext_i18n_rails-0.4.0/lib/gettext_i18n_rails/model_attributes_finder.rb:19:in `each'
.../vendor/gems/gettext_i18n_rails-0.4.0/lib/gettext_i18n_rails/model_attributes_finder.rb:19:in `store_model_attributes'
.../vendor/gems/gettext_i18n_rails-0.4.0/lib/gettext_i18n_rails/model_attributes_finder.rb:8:in `each'
.../vendor/gems/gettext_i18n_rails-0.4.0/lib/gettext_i18n_rails/model_attributes_finder.rb:8:in `store_model_attributes'
.../vendor/gems/gettext_i18n_rails-0.4.0/lib/gettext_i18n_rails/model_attributes_finder.rb:6:in `open'
.../vendor/gems/gettext_i18n_rails-0.4.0/lib/gettext_i18n_rails/model_attributes_finder.rb:6:in `store_model_attributes'
.../lib/tasks/i18n.rake:11