aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorTony Miller <mcfiredrill@gmail.com>2016-02-01 06:29:00 +0900
committerTony Miller <mcfiredrill@gmail.com>2016-02-01 06:29:00 +0900
commit8d25a8aa8c1f67603ad9aaff397bca729afeed1e (patch)
treef213349728b3862dbc88c2c7b01529221476871f /activerecord/lib
parent960de47f0eef79d234eb3cfc47fabb470fef1529 (diff)
downloadrails-8d25a8aa8c1f67603ad9aaff397bca729afeed1e.tar.gz
rails-8d25a8aa8c1f67603ad9aaff397bca729afeed1e.tar.bz2
rails-8d25a8aa8c1f67603ad9aaff397bca729afeed1e.zip
clarify the touch true option does not trigger after_save/update [ci skip]
I've gotten tripped up more than a few times on this, thinking that using `belongs_to` with `touch: true` would trigger my after_save or after_update callbacks. The same text is in the documentation for the touch method itself, but I think its helpful to repeat it again here. It might save people some time.
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/associations.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 70f29debbc..03c8b4c97b 100644
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -1591,6 +1591,8 @@ module ActiveRecord
# If true, the associated object will be touched (the updated_at/on attributes set to current time)
# when this record is either saved or destroyed. If you specify a symbol, that attribute
# will be updated with the current time in addition to the updated_at/on attribute.
+ # Please note that with touching no validation is performed and only the +after_touch+,
+ # +after_commit+ and +after_rollback+ callbacks are executed.
# [:inverse_of]
# Specifies the name of the #has_one or #has_many association on the associated
# object that is the inverse of this #belongs_to association. Does not work in