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 see that #deep_merge! does have different behaviour for unmergeables, but I wonder if instead of using a ! suffix, is should instead use a prefix, in a similar manner to ko_deep_merge!, for consistency within this library.
Overall though, I think consistency with the stdlib is important, and therefore #deep_mergeshould not modify the receiver hash. As a test, I think this should not raise (as it currently does) {}.freeze.deep_merge(a: 1).
The text was updated successfully, but these errors were encountered:
I agree with this one as well, but it will require a major version bump due to a change in signature. We'd also have to come up with new methods for the existing split between preserve_unmergeables => true and false (or perhaps just change the default to false).
I just stumbled into this problem and it prompted us to add an extra deep_dup in our codebase. It works but is hacky, any chance of getting a proper fix?
Given that the
Hash#merge
method does not modify the receiver hash, I think it's really confusing thatHash#deep_merge
does.For
#merge
:but for
#deep_merge
:I see that
#deep_merge!
does have different behaviour for unmergeables, but I wonder if instead of using a!
suffix, is should instead use a prefix, in a similar manner toko_deep_merge!
, for consistency within this library.Overall though, I think consistency with the stdlib is important, and therefore
#deep_merge
should not modify the receiver hash. As a test, I think this should not raise (as it currently does){}.freeze.deep_merge(a: 1)
.The text was updated successfully, but these errors were encountered: