rake db:migrate fails with globalize gem and rails 4.1.7 -
i'm trying utilize globalize gem rails 4.1.7. using latest rvm version, os ubuntu 12.04, db postgresql 9.3.
following instructions found in readme.md on github added translates directive in model , scaffolded migration
class ingredient < activerecord::base translates :name, :description end class createingredienttranslations < activerecord::migration def ingredient.create.translation_table!({ name: :string, descripion: :text }, { migrate_data: true }) end def downwards ingredient.drop_translation_table! migrate_data: true end end
then when rake db:migrate next error
pg::undefinedtable: error: relation "ingredient_translations" not exsist line 5: a.attrelid = '"ingredient_translations"... ^ : select a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod pg_attribute left bring together pg_attrdef d on a.attrelid = d.adrelid , a.attnum = d.adnum a.attrelid = '"ingredient_translations"'::regclass , a.attnum > 0 , not a.attisdropped order a.attnum /home/kranz/.rvm/gems/ruby-2.1.4@recipes/gems/activerecord-4.1.7/lib/active_record/connection_adapters/postgresql_adapter.rb:822:in `async_exec'
this weird. googling around kind of error found ticket in github https://github.com/globalize/globalize/issues/288 opened in dec 2013 , still not closed seems similar; solution seems hack in globalize code, i'd prefer not monkey patching code @ level. due combination of postgres , globalize or there other solution this?
ruby-on-rails-4 rails-activerecord pg globalize
No comments:
Post a Comment