diff options
author | Xavier Noria <fxn@hashref.com> | 2010-06-07 15:44:57 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-06-07 15:44:57 +0200 |
commit | 9e065c6bc175621ad30a416c8c4345f95ce3c264 (patch) | |
tree | 505df4243727a00d1f030205f2e64afe0d098e5e /activesupport/lib/active_support/callbacks.rb | |
parent | 0dbc732995a526354fb1e3c732af5dacdb863dda (diff) | |
parent | 1a8f784a236058101c6e8b6387aefc96e86a1e54 (diff) | |
download | rails-9e065c6bc175621ad30a416c8c4345f95ce3c264.tar.gz rails-9e065c6bc175621ad30a416c8c4345f95ce3c264.tar.bz2 rails-9e065c6bc175621ad30a416c8c4345f95ce3c264.zip |
Merge remote branch 'rails/master'
Diffstat (limited to 'activesupport/lib/active_support/callbacks.rb')
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index 933667c909..ba15043bde 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -390,9 +390,12 @@ module ActiveSupport undef_method "_run_#{symbol}_callbacks" if method_defined?("_run_#{symbol}_callbacks") class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1 def _run_#{symbol}_callbacks(key = nil, &blk) - if self.class.send("_update_#{symbol}_superclass_callbacks") - self.class.__define_runner(#{symbol.inspect}) - return _run_#{symbol}_callbacks(key, &blk) + @_initialized_#{symbol}_callbacks ||= begin + if self.class.send("_update_#{symbol}_superclass_callbacks") + self.class.__define_runner(#{symbol.inspect}) + return _run_#{symbol}_callbacks(key, &blk) + end + true end if key |