svenfuchs/globalize3 — Issue #95: Conflict with method `desc`
Author: pioz
Created: 2012-01-27 00:34:46+00:00
State: open

If I have a class Product with a translate field `desc`

class Product < ActiveRecord::Base
translates :name, :desc
end

and a rake task like this

desc 'Test'
task :foo => :enviroment do
puts Product.first.desc(:en)
end

I get the follow error:

rake aborted!
wrong number of arguments (0 for 1)
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/dsl_definition.rb:124:in `desc'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/dsl_definition.rb:165:in `desc'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/bundler/gems/globalize3-9529a2db82b5/lib/globalize/active_record/adapter.rb:78:in `fetch_attribute'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/bundler/gems/globalize3-9529a2db82b5/lib/globalize/active_record/adapter.rb:24:in `block in fetch'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/bundler/gems/globalize3-9529a2db82b5/lib/globalize/active_record/adapter.rb:23:in `each'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/bundler/gems/globalize3-9529a2db82b5/lib/globalize/active_record/adapter.rb:23:in `fetch'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/bundler/gems/globalize3-9529a2db82b5/lib/globalize/active_record/instance_methods.rb:67:in `read_attribute'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/bundler/gems/globalize3-9529a2db82b5/lib/globalize/active_record/class_methods.rb:112:in `block in translated_attr_accessor'
/Users/pioz/Code/ecommerce/lib/tasks/populate.rake:7:in `block (3 levels) in '
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/pioz/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/bin/rake:33:in `'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/bin/rake:19:in `load'
/Users/pioz/.rvm/gems/ruby-1.9.3-p0/bin/rake:19:in `

'
Tasks: TOP => megiston:populate:foo

Globalize3 gem point to master.