mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Avoid a blank line before the add/remove columns
This commit is contained in:
@@ -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 -%>
|
||||
|
||||
Reference in New Issue
Block a user