when I run migration I get error:
undefined method `set_table_name' for Article::Category::Translation(Table doesn't exist): Class /home/user/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-4.0.0/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
class Article::Category < ActiveRecord::Base
translates :name, :description
class TranslateCategories < ActiveRecord::Migration
:name => :string,
:description => :text
:migrate_data => true
Article::Category.drop_translation_table! :migrate_data => true
Which version of Globalize are you using? Are you using the rails4 branch? In Gemfile:
gem 'globalize3', github: 'svenfuchs/globalize3', branch: 'rails4'
no, I just use
sory, I have not found gem installing instructions for Rails 4 before :)
When I use your solution, I get error while bundle update
Could not find gem 'paper_trail (~> 3.0.0.beta) ruby', which is required by gem 'globalize3 (>= 0) ruby', in any of the sources.
You have to also use the latest version of paper_trail by explicitly putting it in your gemfile, like this:
gem 'paper_trail', github: 'airblade/paper_trail', branch: 'master'
See the rails4 branch readme.
Thnks, it worked!
One more question, do I need :name and :description fields in original article_categories table?
If you have migrated your data to the translations table, you should no longer need the name and description columns in the original table.
Also FYI, the rails4 branch is now master, and we've created a new globalize gem with major version numbers locked to AR numbers, so you can just use:
gem 'globalize', '~> 4.0.0.alpha.2'
Can I close this?
Yeah, thank you!