aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/hash_with_indifferent_access.rb
diff options
context:
space:
mode:
authorChris Zetter <zetter@gmail.com>2011-11-30 15:04:35 +0000
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-06-18 21:49:43 -0300
commit8c07696f470cff823ad0b538ca4bea1594742580 (patch)
treea9775e9453a44be7564de8fd7c38a460c3a6731f /activesupport/lib/active_support/hash_with_indifferent_access.rb
parent32c65d8da3fd28f8577bc23695846d47cdaac6fb (diff)
downloadrails-8c07696f470cff823ad0b538ca4bea1594742580.tar.gz
rails-8c07696f470cff823ad0b538ca4bea1594742580.tar.bz2
rails-8c07696f470cff823ad0b538ca4bea1594742580.zip
Fix lookup on HashWithIndifferentAccess for array values.
Diffstat (limited to 'activesupport/lib/active_support/hash_with_indifferent_access.rb')
-rw-r--r--activesupport/lib/active_support/hash_with_indifferent_access.rb3
1 files changed, 2 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 6e1c0da991..bb47b3560a 100644
--- a/activesupport/lib/active_support/hash_with_indifferent_access.rb
+++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb
@@ -164,7 +164,8 @@ module ActiveSupport
if value.is_a? Hash
value.nested_under_indifferent_access
elsif value.is_a?(Array)
- value.dup.replace(value.map { |e| convert_value(e) })
+ value = value.dup if value.frozen?
+ value.replace(value.map { |e| convert_value(e) })
else
value
end