iain / translatable_columns

Provides proxies for localized columns, depending on the locale set by I18n
http://iain.nl/2008/09/plugin-translatable_columns/
51 stars 5 forks source link

error with validate_translation_of #1

Open ghost opened 14 years ago

ghost commented 14 years ago

When I'm trying to use the above I get an exception:

irb(main):005:0> f=Faculty.first NoMethodError: undefined method validation_method' for #<Class:0xb70b12d0> from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/base.rb:1016:inmethod_missing_without_paginate' from /usr/lib/ruby/gems/1.8/gems/will_paginate-2.3.15/lib/will_paginate/finder.rb:170:in method_missing' from /home/warden/rails_apps/pirate/vendor/plugins/translatable_columns/lib/translatable_columns.rb:141:invalidates_translation_of' from /home/warden/rails_apps/pirate/app/models/faculty.rb:5 from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:454:in load' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:454:inload_file' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in new_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:453:inload_file' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:340:in require_or_load' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:491:inload_missing_constant' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:183:in const_missing' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:181:ineach' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:181:in `const_missing'

Model: class Faculty < ActiveRecord::Base belongs_to :university

translatable_columns :short, :name
validates_translation_of :short, :name

end

iain commented 14 years ago

Which Rails version are you using? It was made for Rails 2.2, and to be honost, I haven't looked at it since then.

ghost commented 14 years ago

Oh, using Rails 3.0.1. Apart from the validations, it works just fine though, i.e. if I disable validates_translation_of.