From b74c7e939ae5bec5c7b98c456a3b9ceb56a0ca17 Mon Sep 17 00:00:00 2001 From: Pavel Pravosud Date: Thu, 23 Feb 2017 14:43:56 -0800 Subject: Make HWIA#compact not return nil when no nils --- activesupport/lib/active_support/hash_with_indifferent_access.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb index 79e7feaf47..f9b269ad69 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -270,7 +270,7 @@ module ActiveSupport end def compact - dup.compact! + dup.tap(&:compact!) end # Convert to a regular hash with string keys. -- cgit v1.2.3