From a7fad65792b37a3f8643149ebbee64cfabfbcea8 Mon Sep 17 00:00:00 2001 From: David Workman Date: Mon, 23 May 2011 13:54:38 +0100 Subject: Simple fix for correctly inverting an add_index migration when a name has been provided --- activerecord/test/cases/migration/command_recorder_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/test/cases/migration') diff --git a/activerecord/test/cases/migration/command_recorder_test.rb b/activerecord/test/cases/migration/command_recorder_test.rb index ae531ebb4c..3e404eaf70 100644 --- a/activerecord/test/cases/migration/command_recorder_test.rb +++ b/activerecord/test/cases/migration/command_recorder_test.rb @@ -86,6 +86,12 @@ module ActiveRecord assert_equal [:remove_index, [:table, {:column => [:one, :two]}]], remove end + def test_invert_add_index_with_name + @recorder.record :add_index, [:table, [:one, :two], {:name => "new_index"}] + remove = @recorder.inverse.first + assert_equal [:remove_index, [:table, {:name => "new_index"}]], remove + end + def test_invert_rename_index @recorder.record :rename_index, [:old, :new] rename = @recorder.inverse.first -- cgit v1.2.3