diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-08-24 06:47:43 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-08-24 06:47:43 -0600 |
commit | 2170950b2f03383da69b275eb0710b78a4a2249a (patch) | |
tree | 08ff0373a42e3d300db7cb3093713dcb4bc8096c /activerecord/test/models/developer.rb | |
parent | 5500e28eb3bb56663bc6e347d4a07a2b54f7b17f (diff) | |
parent | 19b168e611fb8fb547981c4535130c29856efd3a (diff) | |
download | rails-2170950b2f03383da69b275eb0710b78a4a2249a.tar.gz rails-2170950b2f03383da69b275eb0710b78a4a2249a.tar.bz2 rails-2170950b2f03383da69b275eb0710b78a4a2249a.zip |
Merge pull request #21350 from agis-/issue-21223
Only nullify persisted has_one target associations
Diffstat (limited to 'activerecord/test/models/developer.rb')
-rw-r--r-- | activerecord/test/models/developer.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/developer.rb b/activerecord/test/models/developer.rb index d2a5a7fc49..8ac7a9df6a 100644 --- a/activerecord/test/models/developer.rb +++ b/activerecord/test/models/developer.rb @@ -50,6 +50,7 @@ class Developer < ActiveRecord::Base has_many :firms, :through => :contracts, :source => :firm has_many :comments, ->(developer) { where(body: "I'm #{developer.name}") } has_many :ratings, through: :comments + has_one :ship, dependent: :nullify scope :jamises, -> { where(:name => 'Jamis') } |