aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/migration/command_recorder.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-05-27 14:34:05 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-05-27 14:34:05 -0700
commit2a9b3abe193c7d8048b65fb40fba8f4bec697b3f (patch)
tree077da7d54f8a05addd0e6bdeaf907e3294ad186b /activerecord/lib/active_record/migration/command_recorder.rb
parent985ace4d7fd6a1ed4f0964c3172f1f554a88c769 (diff)
parent06436b2cade183db3a231150555c4c999ca2827a (diff)
downloadrails-2a9b3abe193c7d8048b65fb40fba8f4bec697b3f.tar.gz
rails-2a9b3abe193c7d8048b65fb40fba8f4bec697b3f.tar.bz2
rails-2a9b3abe193c7d8048b65fb40fba8f4bec697b3f.zip
Merge pull request #1229 from workmad3/master
Fix for Issue #1205
Diffstat (limited to 'activerecord/lib/active_record/migration/command_recorder.rb')
-rw-r--r--activerecord/lib/active_record/migration/command_recorder.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/migration/command_recorder.rb b/activerecord/lib/active_record/migration/command_recorder.rb
index f9f7448008..ed8e5ae140 100644
--- a/activerecord/lib/active_record/migration/command_recorder.rb
+++ b/activerecord/lib/active_record/migration/command_recorder.rb
@@ -79,8 +79,10 @@ module ActiveRecord
end
def invert_add_index(args)
- table, columns, _ = *args
- [:remove_index, [table, {:column => columns}]]
+ table, columns, options = *args
+ index_name = options.try(:[], :name)
+ options_hash = index_name ? {:name => index_name} : {:column => columns}
+ [:remove_index, [table, options_hash]]
end
def invert_remove_timestamps(args)