Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #5533 from mhfs/migration_blank_line_3_2

[3-2-stable] Remove blank line from generated migration
  • Loading branch information...
commit f829515ad9ca386bf1ae7f2dc342ee3d883ab3be 2 parents 275ee0d + 57c6b4c
@josevalim josevalim authored
View
2  activerecord/lib/rails/generators/active_record/migration/templates/migration.rb
@@ -5,7 +5,7 @@ def change
add_column :<%= table_name %>, :<%= attribute.name %>, :<%= attribute.type %><%= attribute.inject_options %>
<%- if attribute.has_index? -%>
add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
- <%- end %>
+ <%- end -%>
<%- end -%>
end
<%- else -%>
View
1  railties/test/generators/migration_generator_test.rb
@@ -37,6 +37,7 @@ 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.