lib/rails/generators/mobility/templates/column_translations.rb in mobility-0.5.1 vs lib/rails/generators/mobility/templates/column_translations.rb in mobility-0.6.0
- old
+ new
@@ -2,14 +2,14 @@
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." %>
+<% 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 %>
+ add_index :<%= table_name %>, :<%= column_name %><%= attribute.inject_index_options %>, name: :<%= translation_index_name(column_name) %>
<%- end -%>
<% end -%>
<% end -%>
<% end -%>
end