aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorGeorge Claghorn <george.claghorn@gmail.com>2018-08-14 21:27:44 -0400
committerGitHub <noreply@github.com>2018-08-14 21:27:44 -0400
commite715a64732f7b2f82aa809e59cfee83f892795f1 (patch)
treeb3f0749ed8a998284bbc4d2b22324d41c703c6ee /activerecord/test/cases
parentd54435b6bc3d6a2d679ca3cdd9a2a20ea2887893 (diff)
parent50ac00cb73ff189794b5004085b76c81e131df6e (diff)
downloadrails-e715a64732f7b2f82aa809e59cfee83f892795f1.tar.gz
rails-e715a64732f7b2f82aa809e59cfee83f892795f1.tar.bz2
rails-e715a64732f7b2f82aa809e59cfee83f892795f1.zip
Merge pull request #33617 from bogdanvlviv/follow-up-33530
Follow up #33530
Diffstat (limited to 'activerecord/test/cases')
-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 daca296ade..1a19b8dafd 100644
--- a/activerecord/test/cases/migration/command_recorder_test.rb
+++ b/activerecord/test/cases/migration/command_recorder_test.rb
@@ -329,6 +329,11 @@ module ActiveRecord
assert_equal [:add_foreign_key, [:dogs, :people, primary_key: "person_id"]], enable
end
+ def test_invert_remove_foreign_key_with_primary_key_and_to_table_in_options
+ enable = @recorder.inverse_of :remove_foreign_key, [:dogs, to_table: :people, primary_key: "uuid"]
+ assert_equal [:add_foreign_key, [:dogs, :people, primary_key: "uuid"]], enable
+ end
+
def test_invert_remove_foreign_key_with_on_delete_on_update
enable = @recorder.inverse_of :remove_foreign_key, [:dogs, :people, on_delete: :nullify, on_update: :cascade]
assert_equal [:add_foreign_key, [:dogs, :people, on_delete: :nullify, on_update: :cascade]], enable