diff options
author | Paul Nikitochkin <paul.nikitochkin@gmail.com> | 2013-12-22 18:18:40 +0200 |
---|---|---|
committer | Paul Nikitochkin <paul.nikitochkin@gmail.com> | 2013-12-23 15:44:48 +0200 |
commit | 2bcf7158d346e1b619aebbbec360ee0153ef8d06 (patch) | |
tree | c6ada73df4d56a65a9d4ddd5d94c9ae7a53d6333 /activerecord/lib/active_record/associations/builder | |
parent | 00fc64a6dce4930e5f762c1c1d742addc0cf9e42 (diff) | |
download | rails-2bcf7158d346e1b619aebbbec360ee0153ef8d06.tar.gz rails-2bcf7158d346e1b619aebbbec360ee0153ef8d06.tar.bz2 rails-2bcf7158d346e1b619aebbbec360ee0153ef8d06.zip |
On destroying do not touch destroyed belongs to association.
Fixes: #13445
Diffstat (limited to 'activerecord/lib/active_record/associations/builder')
-rw-r--r-- | activerecord/lib/active_record/associations/builder/belongs_to.rb | 2 |
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 |