mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
All intermediate delegation methods should preserve kwargs flag
Since 0456826180
,
`foo(*caller_args)` method call delegation no longer preserve kwargs
flag.
Fixes #44846.
This commit is contained in:
parent
22ca875f9c
commit
714fd07fd9
7 changed files with 10 additions and 7 deletions
|
@ -624,6 +624,7 @@ module ActionMailer
|
||||||
@_message = NullMail.new unless @_mail_was_called
|
@_message = NullMail.new unless @_mail_was_called
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
ruby2_keywords(:process)
|
||||||
|
|
||||||
class NullMail # :nodoc:
|
class NullMail # :nodoc:
|
||||||
def body; "" end
|
def body; "" end
|
||||||
|
|
|
@ -20,7 +20,7 @@ module ActionMailer # :nodoc:
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def process(*)
|
def process(...)
|
||||||
handle_exceptions do
|
handle_exceptions do
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
|
@ -155,6 +155,7 @@ module AbstractController
|
||||||
|
|
||||||
process_action(action_name, *args)
|
process_action(action_name, *args)
|
||||||
end
|
end
|
||||||
|
ruby2_keywords(:process)
|
||||||
|
|
||||||
# Delegates to the class's ::controller_path.
|
# Delegates to the class's ::controller_path.
|
||||||
def controller_path
|
def controller_path
|
||||||
|
@ -215,8 +216,8 @@ module AbstractController
|
||||||
#
|
#
|
||||||
# Notice that the first argument is the method to be dispatched
|
# Notice that the first argument is the method to be dispatched
|
||||||
# which is *not* necessarily the same as the action name.
|
# which is *not* necessarily the same as the action name.
|
||||||
def process_action(method_name, *args)
|
def process_action(...)
|
||||||
send_action(method_name, *args)
|
send_action(...)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Actually call the method associated with the action. Override
|
# Actually call the method associated with the action. Override
|
||||||
|
|
|
@ -244,7 +244,7 @@ module AbstractController
|
||||||
private
|
private
|
||||||
# Override <tt>AbstractController::Base#process_action</tt> to run the
|
# Override <tt>AbstractController::Base#process_action</tt> to run the
|
||||||
# <tt>process_action</tt> callbacks around the normal behavior.
|
# <tt>process_action</tt> callbacks around the normal behavior.
|
||||||
def process_action(*)
|
def process_action(...)
|
||||||
run_callbacks(:process_action) do
|
run_callbacks(:process_action) do
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
|
@ -34,7 +34,7 @@ module ActionView
|
||||||
end
|
end
|
||||||
|
|
||||||
# Override process to set up I18n proxy.
|
# Override process to set up I18n proxy.
|
||||||
def process(*) # :nodoc:
|
def process(...) # :nodoc:
|
||||||
old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
|
old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
|
||||||
super
|
super
|
||||||
ensure
|
ensure
|
||||||
|
|
|
@ -471,6 +471,7 @@ module ActiveModel
|
||||||
def attribute_missing(match, *args, &block)
|
def attribute_missing(match, *args, &block)
|
||||||
__send__(match.proxy_target, match.attr_name, *args, &block)
|
__send__(match.proxy_target, match.attr_name, *args, &block)
|
||||||
end
|
end
|
||||||
|
ruby2_keywords(:attribute_missing)
|
||||||
|
|
||||||
# A +Person+ instance with a +name+ attribute can ask
|
# A +Person+ instance with a +name+ attribute can ask
|
||||||
# <tt>person.respond_to?(:name)</tt>, <tt>person.respond_to?(:name=)</tt>,
|
# <tt>person.respond_to?(:name)</tt>, <tt>person.respond_to?(:name=)</tt>,
|
||||||
|
|
|
@ -429,10 +429,10 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def _exec_scope(*args, &block) # :nodoc:
|
def _exec_scope(...) # :nodoc:
|
||||||
@delegate_to_klass = true
|
@delegate_to_klass = true
|
||||||
registry = klass.scope_registry
|
registry = klass.scope_registry
|
||||||
_scoping(nil, registry) { instance_exec(*args, &block) || self }
|
_scoping(nil, registry) { instance_exec(...) || self }
|
||||||
ensure
|
ensure
|
||||||
@delegate_to_klass = false
|
@delegate_to_klass = false
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue