aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/lib/active_support/hash_with_indifferent_access.rb2
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb2
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