fix Hash#extract! for HashWithIndifferentAccess and non-existant keys #2515

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

tekwiz commented Aug 13, 2011

fix Hash#extract! to work properly with HashWithIndifferentAccess and to not return nil values for keys that don't exist

This commit fixes 2 issues:

First, HashWithIndifferentAccess#extract! used to return a Hash object instead of a HashWithIndifferentAccess object.

Second, Hash#extract! used to include keys with nil values when the original hash didn't have the key. For example {:foo => "foo"}.extract!(:bar) would return {:bar => nil}

fix Hash#extract! to work properly with HashWithIndifferentAccess to …
…not return nil values for keys that don't exist

trshafer commented Dec 3, 2011

+1 this is an awesome change. Hash#extract! should not return nil values for non existant keys. Thanks for your work tekwiz.

Member

arunagw commented Mar 27, 2012

@tekwiz can you please check that if this is still required ?? Or can be closed??

It seems your PR needs a rebase as some code changes already their :-)

Cheers,
Arun

Member

arunagw commented Mar 28, 2012

Closing this for now. Please reopen again with rebase if issue still exists.

Cheers,
Arun

@arunagw arunagw closed this Mar 28, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment