-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clash: cannot nest twice even when key is Clash class #240
Conversation
Right on @luislavena, you're totally right. |
Added inheritance Added multiple bang notation merging Minor performace improvements - ends_with? is faster than regexp
b4c7cd3
to
0e1a8a4
Compare
This just needs a CHANGELOG entry, please (via |
@dblock want me to provide the changelog item? btw, thanks for working on a fix for this! |
Yes, something I can merge. |
Bump @luislavena |
@dblock just to be clear: take your change, change the changelog and then send as a pull request? |
@luislavena I just want you to finish this PR! It needs a CHANGELOG entry. |
Hello @dblock Really sorry to upset you. I do understand you want to get this change merged, however while I originally reported this issue, wasn't me who contributed the change (or turned the issue into a pull request) The user that provided the change is @bartoszkopinski and the changes were in his fork. To be honest is the first time that a reporter of the issue is being asked to provide the Anyway, I went ahead and forked, pulled the changes from @bartoszkopinski branch ( master...luislavena:bk-240-clash-fixes Not sure I should be submitting another pull request for the same and also don't want to take credit for the change made by @bartoszkopinski . Please let me know if I missed something. Thank you. |
My bad @luislavena I didn't notice that :) |
Just make a PR with that? You can amend on behalf of the original author. |
Closed via #321. |
[3.4.6]: hashie/hashie@v3.4.5...v3.4.6 ### Fixed * [#368](hashie/hashie#368): Since `hashie/mash` can be required alone, require its dependencies - [@jrafanie](https://github.com/jrafanie). ## [3.4.5] - 2016-09-16 [3.4.5]: hashie/hashie@v3.4.4...v3.4.5 ### Added * [#337](hashie/hashie#337), [#331](hashie/hashie#331): `Hashie::Mash#load` accepts a `Pathname` object - [@gipcompany](https://github.com/gipcompany). ### Deprecated * [#366](hashie/hashie#366): Hashie is no longer tested on Ruby < 2 - [@dblock](https://github.com/dblock). ### Fixed * [#358](hashie/hashie#358): Fixed support for Array#dig - [@modosc](https://github.com/modosc). * [#365](hashie/hashie#365): Ensured ActiveSupport::HashWithIndifferentAccess is defined before use in #deep_locate - [@mikejarema](https://github.com/mikejarema). ### Miscellanous * [#366](hashie/hashie#366): Added Danger, PR linter - [@dblock](https://github.com/dblock). ## [3.4.4] - 2016-04-29 [3.4.4]: hashie/hashie@v3.4.3...v3.4.4 ### Added * [#349](hashie/hashie#349): Convert `Hashie::Mash#dig` arguments for Ruby 2.3.0 - [@k0kubun](https://github.com/k0kubun). ### Fixed * [#240](hashie/hashie#240): Fixed nesting twice with Clash keys - [@bartoszkopinski](https://github.com/bartoszkopinski). * [#317](hashie/hashie#317): Ensure `Hashie::Extensions::MethodQuery` methods return boolean values - [@michaelherold](https://github.com/michaelherold). * [#319](hashie/hashie#319): Fix a regression from 3.4.1 where `Hashie::Extensions::DeepFind` is no longer indifference-aware - [@michaelherold](https://github.com/michaelherold). * [#322](hashie/hashie#322): Fixed `reverse_merge` issue with `Mash` subclasses - [@marshall-lee](https://github.com/marshall-lee). * [#346](hashie/hashie#346): Fixed `merge` breaking indifferent access - [@docwhat](https://github.com/docwhat), [@michaelherold](https://github.com/michaelherold). * [#350](hashie/hashie#350): Fixed from string translations used with `IgnoreUndeclared` - [@marshall-lee](https://github.com/marshall-lee).
Hello,
In the example found in README:
https://github.com/intridea/hashie#clash
The suggestion to access one of the nested hashes is by using bang methods:
However, a second attempt to do the same results in
ChainError
exception:Of course this is a naive example, as the issue trying to solve is merge nested elements:
There is no way, without using the nested (bang) methods to workaround this limitation.
Looking at the logic of the code:
https://github.com/intridea/hashie/blob/59069f13ea067a319584a56674cc02de887b999f/lib/hashie/clash.rb#L73-L76
Seems that one scenario is missing, which is the case when
self[key]
is already aClash
instance.Wanted to confirm if is the desired behavior, there are alternatives or a pull request might be in order 😁
Thank you!