Skip to content
Browse files

Fixed bad options order in ActiveRecord::Migration::CommandRecorder#i…

…nvert_rename_index
  • Loading branch information...
1 parent bb4dedb commit 24674b344864298135f4f1cecca1214c6b9ddf42 @jbbarth jbbarth committed Aug 28, 2011
View
2 activerecord/lib/active_record/migration/command_recorder.rb
@@ -71,7 +71,7 @@ def invert_add_column(args)
end
def invert_rename_index(args)
- [:rename_index, args.reverse]
+ [:rename_index, [args.first] + args.last(2).reverse]
end
def invert_rename_column(args)
View
4 activerecord/test/cases/migration/command_recorder_test.rb
@@ -104,9 +104,9 @@ def test_invert_add_index_with_no_options
end
def test_invert_rename_index
- @recorder.record :rename_index, [:old, :new]
+ @recorder.record :rename_index, [:table, :old, :new]
rename = @recorder.inverse.first
- assert_equal [:rename_index, [:new, :old]], rename
+ assert_equal [:rename_index, [:table, :new, :old]], rename
end
def test_invert_add_timestamps

0 comments on commit 24674b3

Please sign in to comment.
Something went wrong with that request. Please try again.