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

Ticket #4994 (new defect)

Opened 3 years ago

Last modified 2 years ago

[PATCH] inconsistent parameter handling when using sub-hashes in testing

Reported by: dstar@pele.cx Assigned to: David
Priority: normal Milestone:
Component: ActiveRecord Version:
Severity: normal Keywords:
Cc:

Description

post :new, :baz => {:story_id => 7} results in a value of 7 in the params hash. post :new, :story_id => 7 results in a value of "7" (a string) in the params hash.

7 != "7"

This is a problem. At a minimum it should be consistent, and it really should _not_ change the type of a parameter.

Attachments

test_params_stringify.diff (1.8 kB) - added by kastberg@tkwsping.nl on 08/18/06 14:50:15.

Change History

08/18/06 14:50:15 changed by kastberg@tkwsping.nl

  • attachment test_params_stringify.diff added.

08/18/06 14:51:48 changed by kastberg@tkwsping.nl

  • summary changed from inconsistent parameter handling when using sub-hashes in testing to [PATCH] inconsistent parameter handling when using sub-hashes in testing.

Here's a short patch that stringifies all of them, I think they should, because everything coming in from the internet is strings.

(There should be something in activesupport to recursively stringify a hash)