diff --git a/activesupport/lib/active_support/core_ext/hash/slice.rb b/activesupport/lib/active_support/core_ext/hash/slice.rb index 041e8a217e39af11249a7d6c557148fa697aec3a..dbb3bfd636fd9332fd7275449a1d03689672275f 100644 --- a/activesupport/lib/active_support/core_ext/hash/slice.rb +++ b/activesupport/lib/active_support/core_ext/hash/slice.rb @@ -17,7 +17,7 @@ module Hash #:nodoc: module Slice # Returns a new hash with only the given keys. def slice(*keys) - keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key, true) + keys = keys.map { |key| convert_key(key) } if respond_to?(:convert_key, true) hash = self.class.new keys.each { |k| hash[k] = self[k] if has_key?(k) } hash @@ -27,7 +27,7 @@ def slice(*keys) # Returns a hash contained the removed key/value pairs # {:a => 1, :b => 2, :c => 3, :d => 4}.slice!(:a, :b) # => {:c => 3, :d =>4} def slice!(*keys) - keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key, true) + keys = keys.map { |key| convert_key(key) } if respond_to?(:convert_key, true) omit = slice(*(self.keys - keys)) hash = slice(*keys) replace(hash)