Avoid a blank line before the add/remove columns

This commit is contained in:
Santiago Pastorino 2010-06-25 13:07:17 -03:00
parent 5f64bce10f
commit 3344c011da
1 changed files with 2 additions and 2 deletions

View File

@ -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 -%>