aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorSimon Eskildsen <sirup@sirupsen.com>2015-07-10 03:11:37 +0000
committerSimon Eskildsen <sirup@sirupsen.com>2015-07-10 15:54:37 +0000
commitfa30dd6d2e3151ac2be16673d40cb458a76f1dbe (patch)
treeeb7c4b36cb67a825c0c887de9213f07cc950dc7a /activesupport/lib
parent4ff255a6907cfa01e29fdc9b0f409082f3ee4259 (diff)
downloadrails-fa30dd6d2e3151ac2be16673d40cb458a76f1dbe.tar.gz
rails-fa30dd6d2e3151ac2be16673d40cb458a76f1dbe.tar.bz2
rails-fa30dd6d2e3151ac2be16673d40cb458a76f1dbe.zip
active_support/indifferent_hash: dont raise on to_hash when default_proc raises
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/hash_with_indifferent_access.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb
index bf34a4ef32..63690a1342 100644
--- a/activesupport/lib/active_support/hash_with_indifferent_access.rb
+++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb
@@ -247,7 +247,9 @@ module ActiveSupport
# Convert to a regular hash with string keys.
def to_hash
- _new_hash = Hash.new(default)
+ _new_hash = Hash.new
+ set_defaults(_new_hash)
+
each do |key, value|
_new_hash[key] = convert_value(value, for: :to_hash)
end