Sha256: d931db10389c0108d3809e04f3dfbc61fdf0c5617a594b49344e08baa5c9ff07
Contents?: true
Size: 674 Bytes
Versions: 19
Compression:
Stored size: 674 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 %> <%- end -%> <% end -%> <% end -%> <% end -%> end end
Version data entries
19 entries across 19 versions & 1 rubygems