From fb3ea8b8cb324d174e801d27dc15315b9358486f Mon Sep 17 00:00:00 2001 From: David Lee Date: Tue, 17 May 2011 15:53:54 -0700 Subject: [PATCH] Use dup to preserve previous behavior --- .../lib/active_support/hash_with_indifferent_access.rb | 2 +- activesupport/test/core_ext/hash_ext_test.rb | 2 +- 2 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 39ebc1ec82..15a3717ea1 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -11,7 +11,7 @@ module ActiveSupport end def with_indifferent_access - self + dup end def initialize(constructor = {}) diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index b2c85f15cb..2f0204731b 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -971,7 +971,7 @@ class HashToXmlTest < Test::Unit::TestCase assert_nil hash_wia.default end - def test_should_return_self_for_with_indifferent_access + def test_should_return_dup_for_with_indifferent_access hash_wia = HashWithIndifferentAccess.new assert_equal hash_wia, hash_wia.with_indifferent_access end