Hi all,
I started playing with Globalize 2 and it seems very powerful but I
get an error. Let me first explain the steps that leads to the error
maybe someone could help me spot the problem.
1.First I install Globalize 2 using this
script script/plugin install git://github.com/joshmh/globalize2.git
2.Generate model Post title:string
3.edit migration file by adding this line
Post.create_translation_table! :title => :string
4.then of course I migrate
Now in the console.
I18n.locale = :fr
p = Post.create :title => 'EnglishTitle'
p.save
I18n.locale = :fr
p = Post.find :first
p.title = 'FrenchTitle'
p.save
All seems cool and even when I check the database nothing looks fishy.
But when I try to
p.title
I get the following error
TypeError: can't convert
ActiveRecord::Associations::BelongsToAssociation into String
from Aptana Studio/koivonik/vendor/plugins/globalize2/lib/globalize/
translation.rb:21:in `initialize'
from Aptana Studio/koivonik/vendor/plugins/globalize2/lib/globalize/
translation.rb:21:in `initialize'
from Aptana Studio/koivonik/vendor/plugins/globalize2/lib/globalize/
model/active_record/adapter.rb:73:in `new'
from Aptana Studio/koivonik/vendor/plugins/globalize2/lib/globalize/
model/active_record/adapter.rb:73:in `fetch_attribute'
from Aptana Studio/koivonik/vendor/plugins/globalize2/lib/globalize/
model/active_record/adapter.rb:27:in `fetch'
from Aptana Studio/koivonik/vendor/plugins/globalize2/lib/globalize/
model/active_record.rb:27:in `question'
from (irb):97
I have been trying with this too long now and I feel there is
something trivial I am missing here. Any ideas. Oh and I am new to RoR
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"rails-i18n" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rails-i18n?hl=en
-~----------~----~----~----~------~----~------~--~---