Sha256: 94420729862977eb819e05cc25e876bbf5b4411ee6c9c4ad8409784d8c4f49a2
Contents?: true
Size: 726 Bytes
Versions: 8
Compression:
Stored size: 726 Bytes
Contents
class <%= migration_class_name %> < <%= activerecord_migration_class %> def change <% attributes.each do |attribute| -%> <% I18n.available_locales.each do |locale| -%> <% column_name = Mobility.normalize_locale_accessor(attribute.name, locale) -%> <% if connection.column_exists?(table_name, column_name) -%> <% warn "#{column_name} already exists, skipping." -%> <% else -%> add_column :<%= table_name %>, :<%= column_name %>, :<%= attribute.type %><%= attribute.inject_options %> <%- if attribute.has_index? -%> add_index :<%= table_name %>, :<%= column_name %><%= attribute.inject_index_options %>, name: :<%= translation_index_name(column_name) %> <%- end -%> <% end -%> <% end -%> <% end -%> end end
Version data entries
8 entries across 8 versions & 1 rubygems