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
We can't pass params hash and expect keyword args to be matched because of the current IndifferentHash implementation.
defa(a:, **);enda(Hash[a: 1])# => nila(Sinatra::IndifferentHash[a: 1])# => ArgumentError (wrong number of arguments (given 1, expected 0; required keyword: a))a(**Sinatra::IndifferentHash[a: 1])# => TypeError (hash key "a" is not a Symbol)
Changing the IndifferentHash private method convert_key to always return key.to_s.to_sym solves this.
The text was updated successfully, but these errors were encountered:
This issue has also been brought up in the Rails project. Since this models ActiveSupport::HashWithIndifferentAccess I would like to stay in line with the approach there. I'm wondering if we can also provide a method symbolize_keys that will serve as a work around.
We can't pass
params
hash and expect keyword args to be matched because of the currentIndifferentHash
implementation.Changing the
IndifferentHash
private methodconvert_key
to always returnkey.to_s.to_sym
solves this.The text was updated successfully, but these errors were encountered: