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

Changeset 1066

Show
Ignore:
Timestamp:
04/02/05 08:58:43 (4 years ago)
Author:
david
Message:

Fixed boolean queries for t/f fields in PostgreSQL #995 [dave@cherryville.org]

Files:

Legend:

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

    r1064 r1066  
    11*SVN* 
     2 
     3* Fixed boolean queries for t/f fields in PostgreSQL #995 [dave@cherryville.org] 
    24 
    35* Added that model.items.delete(child) will delete the child, not just set the foreign key to nil, if the child is dependent on the model #978 [bitsweat] 
  • trunk/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb

    r1063 r1066  
    187187          when :date      then string_to_date(value) 
    188188          when :binary    then binary_to_string(value) 
    189           when :boolean   then (value == "t" or value == true ? true : false) 
     189          when :boolean   then value == true or value =~ /^t(rue)?$/i or value.to_s == '1' 
    190190          else value 
    191191        end