aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2017-10-21 15:22:36 +0900
committerAkira Matsuda <ronnie@dio.jp>2017-10-21 15:22:36 +0900
commita524c955bfcce118da0ecb21affe28e2a102a54b (patch)
tree60f6844504922f85d2494b1eba7a2eb644c709c6 /activesupport
parent590e3e7ad3c7c8c9127c580b01885fffa90d3bb6 (diff)
downloadrails-a524c955bfcce118da0ecb21affe28e2a102a54b.tar.gz
rails-a524c955bfcce118da0ecb21affe28e2a102a54b.tar.bz2
rails-a524c955bfcce118da0ecb21affe28e2a102a54b.zip
Hash#slice is in Ruby 2.5+
since r60229
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/slice.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/slice.rb b/activesupport/lib/active_support/core_ext/hash/slice.rb
index 94dc225edb..6a25e779e9 100644
--- a/activesupport/lib/active_support/core_ext/hash/slice.rb
+++ b/activesupport/lib/active_support/core_ext/hash/slice.rb
@@ -23,7 +23,7 @@ class Hash
def slice(*keys)
keys.map! { |key| convert_key(key) } if respond_to?(:convert_key, true)
keys.each_with_object(self.class.new) { |k, hash| hash[k] = self[k] if has_key?(k) }
- end
+ end unless method_defined?(:slice)
# Replaces the hash with only the given keys.
# Returns a hash containing the removed key/value pairs.