我有一个新的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’.
有解决方案吗