1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

This commit is contained in:
Marcelo Silveira 2012-03-21 19:28:34 -03:00
parent 0a12a5f816
commit 86d1dfb821
2 changed files with 1 additions and 2 deletions

View file

@ -26,7 +26,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration
<%= 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 file

@ -37,7 +37,6 @@ class MigrationGeneratorTest < Rails::Generators::TestCase
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