mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
AS::Callbacks: improved __define_runner performance
This commit is contained in:
committed by
Sergey Nartimov
parent
9f8f4c2871
commit
4e8286fe12
@@ -381,9 +381,8 @@ module ActiveSupport
|
||||
name = __callback_runner_name(nil, symbol)
|
||||
undef_method(name) if method_defined?(name)
|
||||
|
||||
silence_warnings do
|
||||
runner_method = "_run_#{symbol}_callbacks"
|
||||
undef_method runner_method if method_defined?(runner_method)
|
||||
runner_method = "_run_#{symbol}_callbacks"
|
||||
unless private_method_defined?(runner_method)
|
||||
class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
|
||||
def #{runner_method}(key = nil, &blk)
|
||||
self.class.__run_callback(key, :#{symbol}, self, &blk)
|
||||
|
||||
Reference in New Issue
Block a user