aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration/command_recorder_test.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2015-06-15 09:12:55 +0200
committerYves Senn <yves.senn@gmail.com>2015-06-15 09:42:26 +0200
commit0e928de345a99a6173efbaa5c87e472dd86e4110 (patch)
tree26077c560e43ff7b2dc16caa4963e83119caefde /activerecord/test/cases/migration/command_recorder_test.rb
parent863fcfa79ae625b891bbd4fbc86a7a1f9553dddd (diff)
downloadrails-0e928de345a99a6173efbaa5c87e472dd86e4110.tar.gz
rails-0e928de345a99a6173efbaa5c87e472dd86e4110.tar.bz2
rails-0e928de345a99a6173efbaa5c87e472dd86e4110.zip
make `remove_index :table, :column` reversible.
This used to raise a `IrreversibleMigration` error (since #10437). However since `remove_index :table, :column` is probably the most basic use-case we should make it reversible again. Conflicts: activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/test/cases/migration/command_recorder_test.rb')
-rw-r--r--activerecord/test/cases/migration/command_recorder_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration/command_recorder_test.rb b/activerecord/test/cases/migration/command_recorder_test.rb
index 24d3c085a7..90b7c6b38a 100644
--- a/activerecord/test/cases/migration/command_recorder_test.rb
+++ b/activerecord/test/cases/migration/command_recorder_test.rb
@@ -206,6 +206,11 @@ module ActiveRecord
end
def test_invert_remove_index
+ add = @recorder.inverse_of :remove_index, [:table, :one]
+ assert_equal [:add_index, [:table, :one]], add
+ end
+
+ def test_invert_remove_index_with_column
add = @recorder.inverse_of :remove_index, [:table, {column: [:one, :two], options: true}]
assert_equal [:add_index, [:table, [:one, :two], options: true]], add
end