Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All intermediate delegation methods should preserve kwargs flag #44850

Merged
merged 1 commit into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions actionmailer/lib/action_mailer/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ def process(method_name, *args) # :nodoc:
@_message = NullMail.new unless @_mail_was_called
end
end
ruby2_keywords(:process)

class NullMail # :nodoc:
def body; "" end
Expand Down
2 changes: 1 addition & 1 deletion actionmailer/lib/action_mailer/rescuable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def handle_exceptions # :nodoc:
end

private
def process(*)
def process(...)
handle_exceptions do
super
end
Expand Down
5 changes: 3 additions & 2 deletions actionpack/lib/abstract_controller/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def process(action, *args)

process_action(action_name, *args)
end
ruby2_keywords(:process)

# Delegates to the class's ::controller_path.
def controller_path
Expand Down Expand Up @@ -215,8 +216,8 @@ def action_method?(name)
#
# Notice that the first argument is the method to be dispatched
# which is *not* necessarily the same as the action name.
def process_action(method_name, *args)
send_action(method_name, *args)
def process_action(...)
send_action(...)
end

# Actually call the method associated with the action. Override
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/abstract_controller/callbacks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def _insert_callbacks(callbacks, block = nil)
private
# Override <tt>AbstractController::Base#process_action</tt> to run the
# <tt>process_action</tt> callbacks around the normal behavior.
def process_action(*)
def process_action(...)
run_callbacks(:process_action) do
super
end
Expand Down
2 changes: 1 addition & 1 deletion actionview/lib/action_view/rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def initialize
end

# 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)
super
ensure
Expand Down
1 change: 1 addition & 0 deletions activemodel/lib/active_model/attribute_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ def method_missing(method, *args, &block)
def attribute_missing(match, *args, &block)
__send__(match.proxy_target, match.attr_name, *args, &block)
end
ruby2_keywords(:attribute_missing)

# A +Person+ instance with a +name+ attribute can ask
# <tt>person.respond_to?(:name)</tt>, <tt>person.respond_to?(:name=)</tt>,
Expand Down
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/relation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,10 @@ def scoping(all_queries: nil, &block)
end
end

def _exec_scope(*args, &block) # :nodoc:
def _exec_scope(...) # :nodoc:
@delegate_to_klass = true
registry = klass.scope_registry
_scoping(nil, registry) { instance_exec(*args, &block) || self }
_scoping(nil, registry) { instance_exec(...) || self }
ensure
@delegate_to_klass = false
end
Expand Down