Skip to content

Commit 714fd07

Browse files
committed
All intermediate delegation methods should preserve kwargs flag
Since ruby/ruby@0456826, `foo(*caller_args)` method call delegation no longer preserve kwargs flag. Fixes rails#44846.
1 parent 22ca875 commit 714fd07

File tree

7 files changed

+10
-7
lines changed

7 files changed

+10
-7
lines changed

actionmailer/lib/action_mailer/base.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ def process(method_name, *args) # :nodoc:
624624
@_message = NullMail.new unless @_mail_was_called
625625
end
626626
end
627+
ruby2_keywords(:process)
627628

628629
class NullMail # :nodoc:
629630
def body; "" end

actionmailer/lib/action_mailer/rescuable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def handle_exceptions # :nodoc:
2020
end
2121

2222
private
23-
def process(*)
23+
def process(...)
2424
handle_exceptions do
2525
super
2626
end

actionpack/lib/abstract_controller/base.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def process(action, *args)
155155

156156
process_action(action_name, *args)
157157
end
158+
ruby2_keywords(:process)
158159

159160
# Delegates to the class's ::controller_path.
160161
def controller_path
@@ -215,8 +216,8 @@ def action_method?(name)
215216
#
216217
# Notice that the first argument is the method to be dispatched
217218
# which is *not* necessarily the same as the action name.
218-
def process_action(method_name, *args)
219-
send_action(method_name, *args)
219+
def process_action(...)
220+
send_action(...)
220221
end
221222

222223
# Actually call the method associated with the action. Override

actionpack/lib/abstract_controller/callbacks.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def _insert_callbacks(callbacks, block = nil)
244244
private
245245
# Override <tt>AbstractController::Base#process_action</tt> to run the
246246
# <tt>process_action</tt> callbacks around the normal behavior.
247-
def process_action(*)
247+
def process_action(...)
248248
run_callbacks(:process_action) do
249249
super
250250
end

actionview/lib/action_view/rendering.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def initialize
3434
end
3535

3636
# Override process to set up I18n proxy.
37-
def process(*) # :nodoc:
37+
def process(...) # :nodoc:
3838
old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
3939
super
4040
ensure

activemodel/lib/active_model/attribute_methods.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ def method_missing(method, *args, &block)
471471
def attribute_missing(match, *args, &block)
472472
__send__(match.proxy_target, match.attr_name, *args, &block)
473473
end
474+
ruby2_keywords(:attribute_missing)
474475

475476
# A +Person+ instance with a +name+ attribute can ask
476477
# <tt>person.respond_to?(:name)</tt>, <tt>person.respond_to?(:name=)</tt>,

activerecord/lib/active_record/relation.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,10 @@ def scoping(all_queries: nil, &block)
429429
end
430430
end
431431

432-
def _exec_scope(*args, &block) # :nodoc:
432+
def _exec_scope(...) # :nodoc:
433433
@delegate_to_klass = true
434434
registry = klass.scope_registry
435-
_scoping(nil, registry) { instance_exec(*args, &block) || self }
435+
_scoping(nil, registry) { instance_exec(...) || self }
436436
ensure
437437
@delegate_to_klass = false
438438
end

0 commit comments

Comments
 (0)