mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
No trailing whitespace in migration generation (closes #10235)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8204 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
class <%= class_name.underscore.camelize %> < ActiveRecord::Migration
|
||||
def self.up<% attributes.each do |attribute| %>
|
||||
<%= migration_action %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'add' %>, :<%= attribute.type %><% end -%>
|
||||
<% end %>
|
||||
<%- end %>
|
||||
end
|
||||
|
||||
def self.down<% attributes.reverse.each do |attribute| %>
|
||||
<%= migration_action == 'add' ? 'remove' : 'add' %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'remove' %>, :<%= attribute.type %><% end -%>
|
||||
<% end %>
|
||||
<%- end %>
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user