diff options
author | Andrew White <pixeltrix@users.noreply.github.com> | 2018-03-30 13:41:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-30 13:41:25 +0100 |
commit | 5e59265af5103946f174782f2fa45acb52e520c4 (patch) | |
tree | 438d4a742c9f5fe7d9b788556c6f0bc3f12f5da0 /activerecord | |
parent | 99c44015b96a4ebf03eb23a8c7d1f9ab1460cb53 (diff) | |
parent | 8f914053e867584d4b294eb91334faf61451f3e9 (diff) | |
download | rails-5e59265af5103946f174782f2fa45acb52e520c4.tar.gz rails-5e59265af5103946f174782f2fa45acb52e520c4.tar.bz2 rails-5e59265af5103946f174782f2fa45acb52e520c4.zip |
Merge pull request #32384 from riseshia/remove-expired-document
Remove expired explanation [ci skip]
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/callbacks.rb | 16 |
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 |