mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Eliminate the need to check for superclass changes to the callback stack each time through the callbacks
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user