Remove extra conditions in HWIDA since Rails 6 does not support Ruby 2.2

See https://github.com/ruby/ruby/blob/ruby_2_3/NEWS
This commit is contained in:
bogdanvlviv 2018-02-17 18:16:15 +02:00 committed by Jeremy Daer
parent debe9a5cbe
commit 2bfef0d21f
2 changed files with 13 additions and 17 deletions

View File

@ -177,7 +177,6 @@ module ActiveSupport
super(convert_key(key), *extras)
end
if Hash.new.respond_to?(:dig)
# Same as <tt>Hash#dig</tt> where the key passed as argument can be
# either a string or a symbol:
#
@ -191,7 +190,6 @@ module ActiveSupport
args[0] = convert_key(args[0]) if args.size > 0
super(*args)
end
end
# Same as <tt>Hash#default</tt> where the key passed as argument can be
# either a string or a symbol:
@ -228,7 +226,7 @@ module ActiveSupport
# hash.fetch_values('a', 'c') # => KeyError: key not found: "c"
def fetch_values(*indices, &block)
indices.collect { |key| fetch(key, &block) }
end if Hash.method_defined?(:fetch_values)
end
# Returns a shallow copy of the hash.
#

View File

@ -169,8 +169,6 @@ class HashWithIndifferentAccessTest < ActiveSupport::TestCase
end
def test_indifferent_fetch_values
skip unless Hash.method_defined?(:fetch_values)
@mixed = @mixed.with_indifferent_access
assert_equal [1, 2], @mixed.fetch_values("a", "b")