Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Avoid another blank line in generated migration and remove assertion as per @spastorino request #5540

Merged
merged 1 commit into from

2 participants

Marcelo Silveira Piotr Sarnacki
Commits on Mar 21, 2012
  1. Marcelo Silveira
This page is out of date. Refresh to see the latest.
2  activerecord/lib/rails/generators/active_record/migration/templates/migration.rb
View
@@ -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
1  railties/test/generators/migration_generator_test.rb
View
@@ -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
Something went wrong with that request. Please try again.