Skip to content

Commit 58dc8b6

Browse files
authored
Merge pull request rails#42954 from kamipo/fix_per_thread_registry
Fix kwargs delegation in `PerThreadRegistry#method_missing`
2 parents f9468ad + e0ce6bb commit 58dc8b6

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

activesupport/lib/active_support/per_thread_registry.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@ def method_missing(name, *args, &block)
5656

5757
send(name, *args, &block)
5858
end
59+
ruby2_keywords(:method_missing)
5960
end
6061
end
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# frozen_string_literal: true
2+
3+
require_relative "abstract_unit"
4+
5+
class PerThreadRegistryTest < ActiveSupport::TestCase
6+
class TestRegistry
7+
extend ActiveSupport::PerThreadRegistry
8+
9+
def foo(x:); x; end
10+
end
11+
12+
def test_method_missing_with_kwargs
13+
assert_equal 1, TestRegistry.foo(x: 1)
14+
end
15+
end

0 commit comments

Comments
 (0)