In a Ruby on Rails app, how would one seed a model (using the seed-fu gem) that has been translated using the globalize3 gem?
I tried seeding both the table and translated table with the code below, but it didn’t work.
fixtures:
products.rb
Product.seed(:id,
{ :id => 1 }
)
product_translation.rb
Product_translation.seed(:id,
{ :id => 1, :product_id => 1, :locale => "en", :name => "foo"},
{ :id => 2, :product_id => 1, :locale => "ja", :name => "bar"}
)
I’ve never used seed-fu, but I know globalize3 fairly well and
Product_translationdoesn’t look right to me. Shouldn’t it beProduct::Translation(orProduct.translation_class)?Maybe this would work:
product_translations.rb