Sha256: a42c1c8ff5153f48de9ff8906ea84530c19ccfee5ef451a2e83b26bda81b5548
Contents?: true
Size: 674 Bytes
Versions: 3
Compression:
Stored size: 674 Bytes
Contents
class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>] def change <%- models.each do |m| -%> create_table :<%= m.model_name.singular %>_translations do |t| t.references :<%= m.model_name.singular %>, null: false t.string :locale, limit: 5, null: false <%- model_attrs[m.name].each do |attr, type| -%> t.<%= type %> :<%= attr %> <%- end -%> t.timestamps end add_index :<%= m.model_name.singular %>_translations, [:<%= m.model_name.singular %>_id, :locale], unique: true, name: '<%= m.table_name %>_ts_<%= m.model_name.singular %>_id_locale' <%- end -%> end end
Version data entries
3 entries across 3 versions & 1 rubygems