1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #2716 from jbbarth/fix_invert_rename_index

Fix bad options order in AR::Migration::CommandRecorder#invert_rename_index
This commit is contained in:
Aaron Patterson 2011-09-05 14:17:55 -07:00
commit 6d93f70c58
2 changed files with 3 additions and 3 deletions

View file

@ -71,7 +71,7 @@ module ActiveRecord
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 file

@ -104,9 +104,9 @@ module ActiveRecord
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