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

Conversation

Projects
None yet
4 participants
@rwz
Contributor

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

codeclimate no new or fixed issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@schneems

This comment has been minimized.

Member

schneems commented Feb 24, 2017

Thanks!

rafaelfranca added a commit that referenced this pull request Feb 24, 2017

Merge pull request #28138 from rwz/rwz/hwia-compact
Make HWIA#compact not return nil when no nils

rafaelfranca added a commit that referenced this pull request Feb 24, 2017

Merge pull request #28138 from rwz/rwz/hwia-compact
Make HWIA#compact not return nil when no nils
@rafaelfranca

This comment has been minimized.

Member

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