diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-02-11 11:12:00 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-02-11 11:20:59 +0100 |
commit | 174f5ed545b1a5aafbca83d70ca011d2fa0d4c78 (patch) | |
tree | 533ca21fc7813abf252a58d7ec6432c93510feb5 /activerecord/test/cases/migration | |
parent | a893718c3165aa6ef6b2b500f7922954ba21eb02 (diff) | |
download | rails-174f5ed545b1a5aafbca83d70ca011d2fa0d4c78.tar.gz rails-174f5ed545b1a5aafbca83d70ca011d2fa0d4c78.tar.bz2 rails-174f5ed545b1a5aafbca83d70ca011d2fa0d4c78.zip |
add test to ensure `remove_reference` with index and fk is invertable.
Diffstat (limited to 'activerecord/test/cases/migration')
-rw-r--r-- | activerecord/test/cases/migration/command_recorder_test.rb | 5 |
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 8cba777fe2..3844b1a92e 100644 --- a/activerecord/test/cases/migration/command_recorder_test.rb +++ b/activerecord/test/cases/migration/command_recorder_test.rb @@ -256,6 +256,11 @@ module ActiveRecord assert_equal [:add_reference, [:table, :taggable, { polymorphic: true }], nil], add end + def test_invert_remove_reference_with_index_and_foreign_key + add = @recorder.inverse_of :remove_reference, [:table, :taggable, { index: true, foreign_key: true }] + assert_equal [:add_reference, [:table, :taggable, { index: true, foreign_key: true }], nil], add + end + def test_invert_remove_belongs_to_alias add = @recorder.inverse_of :remove_belongs_to, [:table, :user] assert_equal [:add_reference, [:table, :user], nil], add |