Permalink
Browse files

Merge pull request #2716 from jbbarth/fix_invert_rename_index

Fix bad options order in AR::Migration::CommandRecorder#invert_rename_index
  • Loading branch information...
2 parents 2175012 + 24674b3 commit 6d93f70c58ca1a1ee3d561421c1d2c12b4cb1cea @tenderlove tenderlove committed Sep 5, 2011
@@ -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)
@@ -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 6d93f70

Please sign in to comment.