Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4823

Show
Ignore:
Timestamp:
08/26/06 03:09:32 (2 years ago)
Author:
david
Message:

Actually, indifferent access mattered in the bowels (hashes hidden in arrays)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb

    r4822 r4823  
    208208            top[-1][key] = value 
    209209          else 
    210             top << {key => value} 
     210            top << {key => value}.with_indifferent_access 
    211211            push top.last 
    212212          end 
  • trunk/actionpack/test/controller/cgi_test.rb

    r4822 r4823  
    4444  def test_deep_query_string_with_array_of_hashes_with_one_pair 
    4545    assert_equal({'x' => {'y' => [{'z' => '10'}, {'z' => '20'}]}}, CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][z]=20')) 
     46    assert_equal("10", CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][z]=20')["x"]["y"].first["z"]) 
     47    assert_equal("10", CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][z]=20').with_indifferent_access[:x][:y].first[:z]) 
    4648  end 
    4749