Merge pull request #5532 from mhfs/migration_blank_line
Remove blank line from generated migration
This commit is contained in:
commit
14b2cf6a0a
@ -5,7 +5,7 @@ def change
|
|||||||
add_column :<%= table_name %>, :<%= attribute.name %>, :<%= attribute.type %><%= attribute.inject_options %>
|
add_column :<%= table_name %>, :<%= attribute.name %>, :<%= attribute.type %><%= attribute.inject_options %>
|
||||||
<%- if attribute.has_index? -%>
|
<%- if attribute.has_index? -%>
|
||||||
add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
|
add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
|
||||||
<%- end %>
|
<%- end -%>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
end
|
end
|
||||||
<%- else -%>
|
<%- else -%>
|
||||||
|
@ -37,6 +37,7 @@ def test_add_migration_with_attributes
|
|||||||
assert_method :change, content do |up|
|
assert_method :change, content do |up|
|
||||||
assert_match(/add_column :posts, :title, :string/, up)
|
assert_match(/add_column :posts, :title, :string/, up)
|
||||||
assert_match(/add_column :posts, :body, :text/, up)
|
assert_match(/add_column :posts, :body, :text/, up)
|
||||||
|
assert_no_match(/\n\n/, up)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user