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

Changeset 4616

Show
Ignore:
Timestamp:
07/21/06 05:52:30 (2 years ago)
Author:
rick
Message:

Strip boolean XML content before checking for 'true' [Rick Olson]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activesupport/CHANGELOG

    r4608 r4616  
    11*SVN* 
     2 
     3* Strip boolean XML content before checking for 'true' [Rick Olson] 
    24 
    35* Customize default BigDecimal formatting. References #5672 [dave@pragprog.com] 
  • trunk/activesupport/lib/active_support/core_ext/hash/conversions.rb

    r4610 r4616  
    9696                    case value["type"] 
    9797                      when "integer"  then content.to_i 
    98                       when "boolean"  then content == "true" 
     98                      when "boolean"  then content.strip == "true" 
    9999                      when "datetime" then ::Time.parse(content).utc 
    100100                      when "date"     then ::Date.parse(content) 
  • trunk/activesupport/test/core_ext/hash_ext_test.rb

    r4607 r4616  
    314314        <author-name>David</author-name> 
    315315        <id type="integer">1</id> 
    316         <approved type="boolean">false</approved> 
     316        <approved type="boolean"> true </approved> 
    317317        <replies-count type="integer">0</replies-count> 
    318318        <written-on type="date">2003-07-16</written-on> 
     
    328328      :author_name => "David", 
    329329      :id => 1, 
    330       :approved => false, 
     330      :approved => true, 
    331331      :replies_count => 0, 
    332332      :written_on => Date.new(2003, 7, 16),