aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorShia <rise.shia@gmail.com>2018-03-30 21:15:55 +0900
committerShia <rise.shia@gmail.com>2018-03-30 21:16:52 +0900
commit8f914053e867584d4b294eb91334faf61451f3e9 (patch)
treede22e48d48a131ca01dc1b680fa2c7e987583126 /activerecord
parentbbd4aad25b38683900a92dd159ecf600509f21ae (diff)
downloadrails-8f914053e867584d4b294eb91334faf61451f3e9.tar.gz
rails-8f914053e867584d4b294eb91334faf61451f3e9.tar.bz2
rails-8f914053e867584d4b294eb91334faf61451f3e9.zip
Remove expired explanation [ci skip]
Override callback doesn't work anymore.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/callbacks.rb16
1 files changed, 1 insertions, 15 deletions
diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb
index 9dbdf845bd..fd6819d08f 100644
--- a/activerecord/lib/active_record/callbacks.rb
+++ b/activerecord/lib/active_record/callbacks.rb
@@ -75,21 +75,7 @@ module ActiveRecord
# end
#
# Now, when <tt>Topic#destroy</tt> is run only +destroy_author+ is called. When <tt>Reply#destroy</tt> is
- # run, both +destroy_author+ and +destroy_readers+ are called. Contrast this to the following situation
- # where the +before_destroy+ method is overridden:
- #
- # class Topic < ActiveRecord::Base
- # def before_destroy() destroy_author end
- # end
- #
- # class Reply < Topic
- # def before_destroy() destroy_readers end
- # end
- #
- # In that case, <tt>Reply#destroy</tt> would only run +destroy_readers+ and _not_ +destroy_author+.
- # So, use the callback macros when you want to ensure that a certain callback is called for the entire
- # hierarchy, and use the regular overwritable methods when you want to leave it up to each descendant
- # to decide whether they want to call +super+ and trigger the inherited callbacks.
+ # run, both +destroy_author+ and +destroy_readers+ are called.
#
# *IMPORTANT:* In order for inheritance to work for the callback queues, you must specify the
# callbacks before specifying the associations. Otherwise, you might trigger the loading of a