Permalink
Browse files

Actually, indifferent access mattered in the bowels (hashes hidden in…

… arrays)

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4823 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent a785190 commit 7b34d0f8c503789f00b1d312a0f24a4cd5c063c5 @dhh dhh committed Aug 26, 2006
@@ -207,7 +207,7 @@ def bind(key, value)
if top[-1].is_a?(Hash) && ! top[-1].key?(key)
top[-1][key] = value
else
- top << {key => value}
+ top << {key => value}.with_indifferent_access
push top.last
end
else
@@ -43,6 +43,8 @@ def test_deep_query_string_with_array_of_hash
def test_deep_query_string_with_array_of_hashes_with_one_pair
assert_equal({'x' => {'y' => [{'z' => '10'}, {'z' => '20'}]}}, CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][z]=20'))
+ assert_equal("10", CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][z]=20')["x"]["y"].first["z"])
+ assert_equal("10", CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][z]=20').with_indifferent_access[:x][:y].first[:z])
end
def test_deep_query_string_with_array_of_hashes_with_multiple_pairs

0 comments on commit 7b34d0f

Please sign in to comment.