From 8588dd431b03616ed815c8ee82a387540a6e571b Mon Sep 17 00:00:00 2001 From: David Workman Date: Mon, 23 May 2011 15:03:42 +0100 Subject: Neatened up the invert_add_index method as per suggeston --- activerecord/lib/active_record/migration/command_recorder.rb | 5 +++-- 1 file 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) -- cgit v1.2.3