diff options
author | Brock Trappitt <brock.trappitt@gmail.com> | 2014-05-05 20:24:04 +0800 |
---|---|---|
committer | Brock Trappitt <brock.trappitt@gmail.com> | 2014-05-21 07:34:53 +0800 |
commit | 713fc39d93601043e027d5cd9ebcfa08064f9417 (patch) | |
tree | ea6e99031f03557f4d94a0b1361d79f0f739d8fe /activerecord/lib/active_record/associations | |
parent | 5508a3e5ca05d4c43232868f40ebd726d251eeac (diff) | |
download | rails-713fc39d93601043e027d5cd9ebcfa08064f9417.tar.gz rails-713fc39d93601043e027d5cd9ebcfa08064f9417.tar.bz2 rails-713fc39d93601043e027d5cd9ebcfa08064f9417.zip |
Prevented belongs_to: touch propagating up if there are no changes being saved
Diffstat (limited to 'activerecord/lib/active_record/associations')
-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 47cc1f4b34..3998aca23e 100644 --- a/activerecord/lib/active_record/associations/builder/belongs_to.rb +++ b/activerecord/lib/active_record/associations/builder/belongs_to.rb @@ -103,7 +103,7 @@ module ActiveRecord::Associations::Builder BelongsTo.touch_record(record, foreign_key, n, touch) } - model.after_save callback + model.after_save callback, if: :changed? model.after_touch callback model.after_destroy callback end |