diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/rails/generators/active_record/migration/templates/migration.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/rails/generators/active_record/migration/templates/migration.rb b/activerecord/lib/rails/generators/active_record/migration/templates/migration.rb index edc6a18d5d..8ac21c1410 100644 --- a/activerecord/lib/rails/generators/active_record/migration/templates/migration.rb +++ b/activerecord/lib/rails/generators/active_record/migration/templates/migration.rb @@ -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 -%> |