diff options
author | David Workman <workmad3@gmail.com> | 2011-05-23 15:03:42 +0100 |
---|---|---|
committer | David Workman <workmad3@gmail.com> | 2011-05-23 15:03:42 +0100 |
commit | 8588dd431b03616ed815c8ee82a387540a6e571b (patch) | |
tree | 4ad07557fc685706b3592d399c4af3999668f950 /activerecord/lib/active_record/migration | |
parent | a7fad65792b37a3f8643149ebbee64cfabfbcea8 (diff) | |
download | rails-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')
-rw-r--r-- | activerecord/lib/active_record/migration/command_recorder.rb | 5 |
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) |