diff options
author | Colin Bartlett <colin@colinabartlett.com> | 2012-03-27 11:41:31 -0400 |
---|---|---|
committer | Colin Bartlett <colin@colinabartlett.com> | 2012-03-27 11:41:31 -0400 |
commit | e5156c9564639cb58f1bf1240add8eb16bb52b57 (patch) | |
tree | c9925312ab11228cd208a8838ca5d4b699f5a29f /activerecord | |
parent | 888fcca01b736b7f91041b7a6a1b162af6688f7a (diff) | |
download | rails-e5156c9564639cb58f1bf1240add8eb16bb52b57.tar.gz rails-e5156c9564639cb58f1bf1240add8eb16bb52b57.tar.bz2 rails-e5156c9564639cb58f1bf1240add8eb16bb52b57.zip |
Fix indenting in migration generator
$ rails generate migration remove_foo_from_bars foo:string
This currently generates:
def up
remove_column :bars, :foo
end
Fix it:
def up
remove_column :bars, :foo
end
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 9ca63a209e..b9b5ec7956 100644 --- a/activerecord/lib/rails/generators/active_record/migration/templates/migration.rb +++ b/activerecord/lib/rails/generators/active_record/migration/templates/migration.rb @@ -13,9 +13,9 @@ class <%= migration_class_name %> < ActiveRecord::Migration <% attributes.each do |attribute| -%> <%- if migration_action -%> <%= migration_action %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'add' %>, :<%= attribute.type %><%= attribute.inject_options %><% end %> - <% if attribute.has_index? && migration_action == 'add' %> + <%- if attribute.has_index? && migration_action == 'add' -%> add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %> - <% end -%> + <%- end -%> <%- end -%> <%- end -%> end |