我有一个新的 Rails 引擎,我想使用 globalize3。我在我的 lib//engine.rb 中做到了这一点:
require 'globalize3'
module SimpleCms
  class Engine < ::Rails::Engine
  end
end
现在,我尝试创建这样的迁移:
class CreatePages < ActiveRecord::Migration
  def up
    create_table :pages do |t|
      t.string :path
      t.timestamps
    end
    Page.create_translation_table! title: :string, body: :body
  end
  def down
    drop_table :pages
    Page.drop_translation_table!
  end
end
我有这个错误:
undefined method `create_translation_table!' for #<Class:0x00000001d5ca18>
我认为文件 'lib/globalize/active_record/migration.rb' 没有加载。
有什么解决办法吗?