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
Here, other_hash is of class Hash, so of course Hash#merge doesn't play with Hashie::Mash's key conversion. Not sure how you'd fix it efficiently (Hash#merge being an MRI builtin), but maybe monkeypatch in a Hashie::Mash#reverse_merge like
Looking at the source for Hashie::Mash now, I realize that you're already defining a custom #merge method, so...seems like #reverse_merge isn't too far of a stretch. Could even just do it like this:
I don't know how much of a concern ActiveSupport compatibility is for you, but I thought that this behavior was surprising:
This is of course a consequence of ActiveSupport defining
reverse_merge
asHere,
other_hash
is of classHash
, so of courseHash#merge
doesn't play withHashie::Mash
's key conversion. Not sure how you'd fix it efficiently (Hash#merge
being an MRI builtin), but maybe monkeypatch in aHashie::Mash#reverse_merge
likeDoesn't capture
block_given?
behavior or anything, though.Another workaround for now is just
or doing the
||=
s by hand.The text was updated successfully, but these errors were encountered: