mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05: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:
parent
566903484c
commit
ea713b6bb9
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue