From a3d4a5c0481afff218e808eebd349c98d31686f6 Mon Sep 17 00:00:00 2001 From: laserlemon Date: Tue, 28 Sep 2010 10:58:06 -0400 Subject: [PATCH] Allowed subclasses of HashWithIndifferentAccess to inherit gracefully. [#5724 state:resolved] --- .../active_support/hash_with_indifferent_access.rb | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb index e8215bc..a7a245b 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -28,7 +28,7 @@ module ActiveSupport end def self.new_from_hash_copying_default(hash) - ActiveSupport::HashWithIndifferentAccess.new(hash).tap do |new_hash| + new(hash).tap do |new_hash| new_hash.default = hash.default end end @@ -95,7 +95,7 @@ module ActiveSupport # Returns an exact copy of the hash. def dup - HashWithIndifferentAccess.new(self) + self.class.new(self) end # Merges the instantized and the specified hashes together, giving precedence to the values from the second hash -- 1.7.3