aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/migration/command_recorder.rb
diff options
context:
space:
mode:
authorDavid Workman <workmad3@gmail.com>2011-05-23 15:03:42 +0100
committerDavid Workman <workmad3@gmail.com>2011-05-23 15:03:42 +0100
commit8588dd431b03616ed815c8ee82a387540a6e571b (patch)
tree4ad07557fc685706b3592d399c4af3999668f950 /activerecord/lib/active_record/migration/command_recorder.rb
parenta7fad65792b37a3f8643149ebbee64cfabfbcea8 (diff)
downloadrails-8588dd431b03616ed815c8ee82a387540a6e571b.tar.gz
rails-8588dd431b03616ed815c8ee82a387540a6e571b.tar.bz2
rails-8588dd431b03616ed815c8ee82a387540a6e571b.zip
Neatened up the invert_add_index method as per suggeston
Diffstat (limited to 'activerecord/lib/active_record/migration/command_recorder.rb')
-rw-r--r--activerecord/lib/active_record/migration/command_recorder.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/migration/command_recorder.rb b/activerecord/lib/active_record/migration/command_recorder.rb
index 5f4dd798a7..5923993229 100644
--- a/activerecord/lib/active_record/migration/command_recorder.rb
+++ b/activerecord/lib/active_record/migration/command_recorder.rb
@@ -81,10 +81,11 @@ module ActiveRecord
def invert_add_index(args)
table, columns, options = *args
if options && options[:name]
- [:remove_index, [table, {:name => options[:name]}]]
+ options_hash = {:name => options[:name]}
else
- [:remove_index, [table, {:column => columns}]]
+ options_hash = {:column => columns}
end
+ [:remove_index, [table, options_hash]]
end
def invert_remove_timestamps(args)