aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/callbacks.rb
diff options
context:
space:
mode:
authorRolf Timmermans <r.timmermans@voormedia.com>2011-03-12 23:05:52 +0800
committerJosé Valim <jose.valim@gmail.com>2011-03-13 01:35:29 +0800
commit1a3fe8ce42e202630e6b1d8cf7137002e270ebdb (patch)
treeededececae28f3ca6369f53c64085fae9b0f9c60 /activesupport/lib/active_support/callbacks.rb
parent46f6a2e3889bae420589f429b09722a37dbdf18d (diff)
downloadrails-1a3fe8ce42e202630e6b1d8cf7137002e270ebdb.tar.gz
rails-1a3fe8ce42e202630e6b1d8cf7137002e270ebdb.tar.bz2
rails-1a3fe8ce42e202630e6b1d8cf7137002e270ebdb.zip
Prevent callbacks in child classes from being executed more than once.
Diffstat (limited to 'activesupport/lib/active_support/callbacks.rb')
-rw-r--r--activesupport/lib/active_support/callbacks.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index a7a7836f03..418102352f 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -416,7 +416,7 @@ module ActiveSupport
options = filters.last.is_a?(Hash) ? filters.pop : {}
filters.unshift(block) if block
- ([self] + ActiveSupport::DescendantsTracker.descendants(self)).each do |target|
+ ([self] + ActiveSupport::DescendantsTracker.descendants(self)).reverse.each do |target|
chain = target.send("_#{name}_callbacks")
yield target, chain.dup, type, filters, options
target.__define_runner(name)