From c918a3a0691d54f0702c26aac3f47e9449fd2a24 Mon Sep 17 00:00:00 2001 From: Jon Moss Date: Mon, 1 Feb 2016 21:16:07 -0500 Subject: Fix regression in `Hash#dig` for HashWithIndifferentAccess. --- .../lib/active_support/hash_with_indifferent_access.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'activesupport/lib/active_support/hash_with_indifferent_access.rb') diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb index b878f31e75..03770a197c 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -69,9 +69,13 @@ module ActiveSupport end def default(*args) - key = args.first - args[0] = key.to_s if key.is_a?(Symbol) - super(*args) + arg_key = args.first + + if include?(key = convert_key(arg_key)) + self[key] + else + super + end end def self.new_from_hash_copying_default(hash) -- cgit v1.2.3