diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/hash/compact.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/hash/compact.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/compact.rb b/activesupport/lib/active_support/core_ext/hash/compact.rb index f072530e04..78b3387c3b 100644 --- a/activesupport/lib/active_support/core_ext/hash/compact.rb +++ b/activesupport/lib/active_support/core_ext/hash/compact.rb @@ -7,7 +7,7 @@ class Hash # { c: nil }.compact # => {} # { c: true }.compact # => { c: true } def compact - self.select { |_, value| !value.nil? } + select { |_, value| !value.nil? } end # Replaces current hash with non +nil+ values. @@ -18,6 +18,6 @@ class Hash # hash # => { a: true, b: false } # { c: true }.compact! # => nil def compact! - self.reject! { |_, value| value.nil? } + reject! { |_, value| value.nil? } end end |