Skip to content
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

Fix crash building a Mash w/ IndifferentAccess from HashWithIndifferentAccess #277

Conversation

gardenofwine
Copy link
Contributor

When using an ActiveRecord::HashWithIndifferentAccess that is nested (i.e. {a: {b: 1}}) to create a Mash with the IndifferentAccess extension, an ArgumentException is raised. This is because the IndifferentAccess method convert_value overrides ActiveRecord::HashWithIndifferentAccess's method of the same name. Changing the method name in IndifferentAccess solves the issue.

@gardenofwine gardenofwine force-pushed the fix_integration_with_hash_with_indifferent_access branch 2 times, most recently from 67abbfe to a3671c4 Compare February 4, 2015 15:55
@@ -1,6 +1,7 @@
## Next Release

* [#269](https://github.com/intridea/hashie/pull/272): Added Hashie::Extensions::DeepLocate - [@msievers](https://github.com/msievers).
* [#270](https://github.com/intridea/hashie/pull/277): Fixed crash with IndifferentAccess and HashWithIndifferentAccess - [@gardenofwine](https://github.com/gardenofwine).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be something other than "crash", maybe "Fix: ArgumentException raised when ..."

@dblock
Copy link
Member

dblock commented Feb 4, 2015

See my comments above, minor picky things.

(Rbx build failure is unrelated, caused by rspec/rspec-core#1863)

…ntAccess

When using an ActiveRecord::HashWithIndifferentAccess that is nested (i.e. {a: {b: 1}}) to create a Mash with the IndifferentAccess extension, an ArgumentException is raised. This is because the IndifferentAccess method `convert_value` overrides ActiveRecord::HashWithIndifferentAccess's method of the same name. Changing the method name in IndifferentAccess solves the issue.
@gardenofwine gardenofwine force-pushed the fix_integration_with_hash_with_indifferent_access branch from a3671c4 to da23254 Compare February 5, 2015 08:50
dblock added a commit that referenced this pull request Feb 5, 2015
…ith_indifferent_access

Fix crash building a Mash w/ IndifferentAccess from HashWithIndifferentAccess
@dblock dblock merged commit 09821f3 into hashie:master Feb 5, 2015
@dblock
Copy link
Member

dblock commented Feb 5, 2015

Merged.

uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Feb 5, 2015
was rolled-up (hashie/hashie#277).

Sponsored by:	http://sybpipe.com/


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@378479 35697150-7ecd-e111-bb59-0022644237b5
uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Feb 5, 2015
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Jun 9, 2015
## 3.4.2 (6/2/2015)

* [#292](hashie/hashie#292): Removed `Mash#id` and `Mash#type` - [@jrochkind](https://github.com/jrochkind).
* [#297](hashie/hashie#297): Extracted `Trash`'s behavior into a new `Dash::PropertyTranslation` extension - [@michaelherold](https://github.com/michaelherold).

## 3.4.1

* [#269](hashie/hashie#272): Added Hashie::Extensions::DeepLocate - [@msievers](https://github.com/msievers).
* [#270](hashie/hashie#277): Fixed ArgumentError raised when using IndifferentAccess and HashWithIndifferentAccess - [@gardenofwine](https://github.com/gardenofwine).
* [#281](hashie/hashie#281): Added #reverse_merge to Mash to override ActiveSupport's version - [@mgold](https://github.com/mgold).
* [#282](hashie/hashie#282): Fixed coercions in a subclass accumulating in the superclass - [@maxlinc](https://github.com/maxlinc), [@martinstreicher](https://github.com/martinstreicher).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants