diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2019-01-16 22:00:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-16 22:00:51 +0100 |
commit | cb3f78aa7c8f14921501703ed0780f2a428bc6a1 (patch) | |
tree | 8eb4807d949160d38a3d239ea33d37318d38b5aa /activerecord/test/models | |
parent | d49899c15431104f8dad374363bac57479b4bd39 (diff) | |
parent | 7e52e3b1c004eb22521c844b6adf69a2689cc1da (diff) | |
download | rails-cb3f78aa7c8f14921501703ed0780f2a428bc6a1.tar.gz rails-cb3f78aa7c8f14921501703ed0780f2a428bc6a1.tar.bz2 rails-cb3f78aa7c8f14921501703ed0780f2a428bc6a1.zip |
Merge branch 'master' into db_system_change_command
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/drink_designer.rb | 6 | ||||
-rw-r--r-- | activerecord/test/models/person.rb | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/models/drink_designer.rb b/activerecord/test/models/drink_designer.rb index eb6701b84e..8258408f35 100644 --- a/activerecord/test/models/drink_designer.rb +++ b/activerecord/test/models/drink_designer.rb @@ -4,5 +4,11 @@ class DrinkDesigner < ActiveRecord::Base has_one :chef, as: :employable end +class DrinkDesignerWithPolymorphicDependentNullifyChef < ActiveRecord::Base + self.table_name = "drink_designers" + + has_one :chef, as: :employable, dependent: :nullify +end + class MocktailDesigner < DrinkDesigner end diff --git a/activerecord/test/models/person.rb b/activerecord/test/models/person.rb index 5cba1e440e..c3d15a571a 100644 --- a/activerecord/test/models/person.rb +++ b/activerecord/test/models/person.rb @@ -62,6 +62,11 @@ class PersonWithDependentNullifyJobs < ActiveRecord::Base has_many :jobs, source: :job, through: :references, dependent: :nullify end +class PersonWithPolymorphicDependentNullifyComments < ActiveRecord::Base + self.table_name = "people" + has_many :comments, as: :author, dependent: :nullify +end + class LoosePerson < ActiveRecord::Base self.table_name = "people" self.abstract_class = true |