Class: PufferPages::Globalize::Migrator
- Inherits:
-
Globalize::ActiveRecord::Migration::Migrator
- Object
- Globalize::ActiveRecord::Migration::Migrator
- PufferPages::Globalize::Migrator
- Defined in:
- lib/puffer_pages/globalize/migrator.rb
Instance Method Summary collapse
Instance Method Details
#create_translation_table ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/puffer_pages/globalize/migrator.rb', line 6 def create_translation_table connection.create_table(translations_table_name, id: false) do |t| t.uuid :id, primary_key: true t.uuid "#{table_name.sub(/^#{table_name_prefix}/, '').singularize}_id" t.string :locale fields.each do |name, | if .is_a? Hash t.column name, .delete(:type), else t.column name, end end t. end end |