aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/migration/command_recorder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/migration/command_recorder.rb')
-rw-r--r--activerecord/lib/active_record/migration/command_recorder.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/migration/command_recorder.rb b/activerecord/lib/active_record/migration/command_recorder.rb
index 5923993229..88752aa013 100644
--- a/activerecord/lib/active_record/migration/command_recorder.rb
+++ b/activerecord/lib/active_record/migration/command_recorder.rb
@@ -80,11 +80,8 @@ module ActiveRecord
def invert_add_index(args)
table, columns, options = *args
- if options && options[:name]
- options_hash = {:name => options[:name]}
- else
- options_hash = {:column => columns}
- end
+ index_name = options.try(:[], :name)
+ options_hash = index_name ? {:name => index_name} : {:column => columns}
[:remove_index, [table, options_hash]]
end