Class: CreateTranslations
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateTranslations
- Defined in:
- lib/generators/acts_as_simple_translatable/templates/migration.rb
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/generators/acts_as_simple_translatable/templates/migration.rb', line 2 def change # create translations table if it doesn't exist create_table :translations do |t| t.integer :translatable_id, required: true t.string :translatable_type, required: true t.string :translatable_field, required: true t.string :locale, length: 5, required: true t.text :content t. end # add index add_index :translations, [:translatable_id, :translatable_type, :locale], name: 'record_translations_index' end |