aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-12-23 05:50:51 -0800
committerYves Senn <yves.senn@gmail.com>2013-12-23 05:50:51 -0800
commit32c8aee04bfa53e985926976279505f7bc8f654f (patch)
treec6ada73df4d56a65a9d4ddd5d94c9ae7a53d6333 /activerecord/lib/active_record
parent00fc64a6dce4930e5f762c1c1d742addc0cf9e42 (diff)
parent2bcf7158d346e1b619aebbbec360ee0153ef8d06 (diff)
downloadrails-32c8aee04bfa53e985926976279505f7bc8f654f.tar.gz
rails-32c8aee04bfa53e985926976279505f7bc8f654f.tar.bz2
rails-32c8aee04bfa53e985926976279505f7bc8f654f.zip
Merge pull request #13455 from jetthoughts/13445_fix_touch_destroyed_record
On destroying do not touch destroyed belongs to association.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/associations/builder/belongs_to.rb2
1 files changed, 1 insertions, 1 deletions
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