Background: Due to a few nested resources combined with complex forms, I have a naming scheme like "a[b][][c][d]" for my form fields (actually it's e.g. "company[branch][][address][street|city_id|etc.]"). The forms worked fine while I only had the "[]" and "[][xx]" formats, but broke with "[][xx][xx]". Here's sample output:
ActionController::UrlEncodedPairParser.new([['a[b][][c][d]','1'],['a[b][][c][d]','2'],['a[b][][c][d]','3']]).result
=> {"a"=>{"b"=>[{"c"=>{}}, {"c"=>{}}, {"c"=>{}}]}}
which is obviously (?) broken. After the patch:
ActionController::UrlEncodedPairParser.new([['a[b][][c][d]','1'],['a[b][][c][d]','2'],['a[b][][c][d]','3']]).result
=> {"a"=>{"b"=>[{"c"=>{"d"=>"1"}}, {"c"=>{"d"=>"2"}}, {"c"=>{"d"=>"3"}}]}}
which is what I wanted (and looks correct).
The only thing that the patch does is remove the ".with_indifferent_access" while pushing a hash. I'm not really sure why that was used in the first place. Also "rake test" doesn't run on my tree (./test/controller/new_render_test.rb:3: superclass mismatch for class Customer (TypeError)) so I didn't add a test for this.