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

Ticket #9839 (new enhancement)

Opened 9 months ago

Last modified 7 months ago

[PATCH][TINY] Hash#from_xml boolean conversion should match ActiveRecord's approach

Reported by: dkubb Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveSupport Version: edge
Severity: normal Keywords: tiny xml
Cc:

Description

ActiveRecord maps 't', 'true' and '1' to true when storing a boolean value in the DB. It is case insensitive.

Hash#from_xml maps 'true' and '1' to true when parsing a boolean value. It is case *sensitive* also.

This small patch (includes unit test) makes Hash#from_xml acts like ActiveRecord in its parsing and treatment of boolean values.

Attachments

mixed_case_boolean_from_xml.patch (2.0 kB) - added by dkubb on 10/10/07 20:32:26.

Change History

10/10/07 20:32:26 changed by dkubb

  • attachment mixed_case_boolean_from_xml.patch added.

10/10/07 20:33:20 changed by dkubb

  • keywords changed from tiny to tiny xml.
  • summary changed from [PATCH] Hash#from_xml boolean conversion should match ActiveRecord's to [PATCH][TINY] Hash#from_xml boolean conversion should match ActiveRecord's approach.

11/24/07 17:58:27 changed by josh

+1

12/18/07 10:23:20 changed by maruis

+1 Works as advertised.