aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/hash_with_indifferent_access.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/hash_with_indifferent_access.rb')
-rw-r--r--activesupport/lib/active_support/hash_with_indifferent_access.rb10
1 files changed, 7 insertions, 3 deletions
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)