From 2bcf7158d346e1b619aebbbec360ee0153ef8d06 Mon Sep 17 00:00:00 2001 From: Paul Nikitochkin Date: Sun, 22 Dec 2013 18:18:40 +0200 Subject: On destroying do not touch destroyed belongs to association. Fixes: #13445 --- activerecord/lib/active_record/associations/builder/belongs_to.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations/builder/belongs_to.rb b/activerecord/lib/active_record/associations/builder/belongs_to.rb index 62cc1e3a8d..5ccaa55a32 100644 --- a/activerecord/lib/active_record/associations/builder/belongs_to.rb +++ b/activerecord/lib/active_record/associations/builder/belongs_to.rb @@ -112,7 +112,7 @@ module ActiveRecord::Associations::Builder end record = o.send name - unless record.nil? || record.new_record? + if record && record.persisted? if touch != true record.touch touch else -- cgit v1.2.3