You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got some inexplicable "ArgumentError: wrong number of arguments (given 1, expected 0)" errors against Rails edge today. I traced it back to some Ruby 2-era argument forwarding in goldiloader. Turns out there's a bit of that in the ActiveRecord patches that needs to be updated to be compatible with Ruby 3.
To make the issue clear, take this simple example:
Today this uses Ruby 2-era argument forwarding that doesn't separate out
keyword arguments in Ruby 3. Update the forwarding technique to be
compatible with Ruby 3.
Fixsalsify#157
Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
I got some inexplicable "ArgumentError: wrong number of arguments (given 1, expected 0)" errors against Rails edge today. I traced it back to some Ruby 2-era argument forwarding in goldiloader. Turns out there's a bit of that in the ActiveRecord patches that needs to be updated to be compatible with Ruby 3.
To make the issue clear, take this simple example:
This runs fine on ruby 2.5:
Also fine on 2.7:
However, it does NOT work on 3.0:
As you can see, that ends up passing kwargs as a positional arg. In my case, since upstream
find_target
only accepts kwargs, it explodes.In Ruby 3 we can use a combination of
...
and explicit*args, **kwargs
.The text was updated successfully, but these errors were encountered: