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

Make HWIA#compact not return nil when no nils #28138

Merged
merged 1 commit into from Feb 24, 2017
Merged

Conversation

@rwz
Copy link
Contributor

@rwz rwz commented Feb 23, 2017

Summary

In ActiveSupport 5 HashWithIndifferentAccess#compact currently returns nil when hash doesn't contain nil values in it. This PR fixes it.

Example:

HashWithIndifferentAccess.new.compact       # => nil, expected {}
{foo: :bar}.with_indifferent_access.compact # => nil, expected { "foo" => :bar }

Note: this fix will also have to be backported into 4-2 branch since the same bug was recently introduced there as well by 828e019

@rwz rwz force-pushed the rwz:rwz/hwia-compact branch Feb 23, 2017
@rwz rwz force-pushed the rwz:rwz/hwia-compact branch to b74c7e9 Feb 23, 2017
@schneems schneems merged commit 9f46b5f into rails:master Feb 24, 2017
2 checks passed
2 checks passed
codeclimate no new or fixed issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@schneems
Copy link
Member

@schneems schneems commented Feb 24, 2017

Thanks!

rafaelfranca added a commit that referenced this pull request Feb 24, 2017
Make HWIA#compact not return nil when no nils
rafaelfranca added a commit that referenced this pull request Feb 24, 2017
Make HWIA#compact not return nil when no nils
@rafaelfranca
Copy link
Member

@rafaelfranca rafaelfranca commented Feb 24, 2017

Backported in 8b2d978 and b609909

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants