Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Avoid another blank line in generated migration and remove assertion …

…as per @spastorino request
  • Loading branch information...
commit 86d1dfb821dcc31897a0899e9b0933852d33cac3 1 parent 0a12a5f
@mhfs mhfs authored
View
2  activerecord/lib/rails/generators/active_record/migration/templates/migration.rb
@@ -26,7 +26,7 @@ def down
<%= migration_action == 'add' ? 'remove' : 'add' %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'remove' %>, :<%= attribute.type %><%= attribute.inject_options %><% end %>
<%- if attribute.has_index? && migration_action == 'remove' -%>
add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
- <%- end %>
+ <%- end -%>
<%- end -%>
<%- end -%>
end
View
1  railties/test/generators/migration_generator_test.rb
@@ -37,7 +37,6 @@ def test_add_migration_with_attributes
assert_method :change, content do |up|
assert_match(/add_column :posts, :title, :string/, up)
assert_match(/add_column :posts, :body, :text/, up)
- assert_no_match(/\n\n/, up)
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.