提交 b64a66a1 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #29595 from fatkodima/result_lambda_class_checking

Remove useless class checking for `ActiveSupport::Callbacks`s result_lambda
......@@ -29,7 +29,7 @@ module Callbacks
included do
define_callbacks :process_action,
terminator: ->(controller, result_lambda) { result_lambda.call if result_lambda.is_a?(Proc); controller.performed? },
terminator: ->(controller, result_lambda) { result_lambda.call; controller.performed? },
skip_after_callbacks_if_terminated: true
end
......
......@@ -596,7 +596,7 @@ def default_terminator
Proc.new do |target, result_lambda|
terminate = true
catch(:abort) do
result_lambda.call if result_lambda.is_a?(Proc)
result_lambda.call
terminate = false
end
terminate
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册