Avoid a blank line before the add/remove columns
This commit is contained in:
parent
5f64bce10f
commit
3344c011da
|
@ -1,6 +1,6 @@
|
|||
class <%= migration_class_name %> < ActiveRecord::Migration
|
||||
def self.up
|
||||
<% attributes.each do |attribute| %>
|
||||
<% attributes.each do |attribute| -%>
|
||||
<%- if migration_action -%>
|
||||
<%= migration_action %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'add' %>, :<%= attribute.type %><% end %>
|
||||
<%- end -%>
|
||||
|
@ -8,7 +8,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration
|
|||
end
|
||||
|
||||
def self.down
|
||||
<% attributes.reverse.each do |attribute| %>
|
||||
<% attributes.reverse.each do |attribute| -%>
|
||||
<%- if migration_action -%>
|
||||
<%= migration_action == 'add' ? 'remove' : 'add' %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'remove' %>, :<%= attribute.type %><% end %>
|
||||
<%- end -%>
|
||||
|
|
Loading…
Reference in New Issue