Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bad options order in AR::Migration::CommandRecorder#invert_rename_index #2716

Merged
merged 1 commit into from Sep 5, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions activerecord/test/cases/migration/command_recorder_test.rb
Expand Up @@ -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
Expand Down