From 6607618afd88810aeb1dad5dbecf0273faf2cc05 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Thu, 16 Jan 2020 07:05:20 +0900 Subject: [PATCH] If `dependent: nil` is valid for has_many, it also be valid for has_one Follow up #35504. [ci skip] --- activerecord/lib/active_record/associations.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index ed9d185fe4..06117c8fd2 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1434,6 +1434,7 @@ module ActiveRecord # Controls what happens to the associated object when # its owner is destroyed: # + # * nil do nothing (default). # * :destroy causes the associated object to also be destroyed # * :delete causes the associated object to be deleted directly from the database (so callbacks will not execute) # * :nullify causes the foreign key to be set to +NULL+. Polymorphic type column is also nullified