mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Eliminate the need to check for superclass changes to the callback stack each time through the callbacks
This commit is contained in:
parent
a87b627297
commit
220603ee70
1 changed files with 6 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue