jdbc_postgre.rb issue handling nil booleans
-------------------------------------------

                 Key: JRUBY-2884
                 URL: http://jira.codehaus.org/browse/JRUBY-2884
             Project: JRuby
          Issue Type: Bug
          Components: ActiveRecord-JDBC
         Environment: Darwin woot.local 9.4.0 Darwin Kernel Version 9.4.0: Mon 
Jun  9 19:30:53 PDT 2008; root:xnu-1228.5.20~1/RELEASE_I386 i386
            Reporter: Dylan Stamat
         Attachments: jdbc_postgres_boolean_patch.diff

Problem
=========
When no default is chosen for a boolean value in an AR migration, MRI defaults 
the columns default value to nil, but the jdbc postgres 
adapter is defaulting it to false.

Solution
=========
Return nil instead of false for explicitly nil values

Example
=========
class CreateStuffs < ActiveRecord::Migration                                    
                                                                                
                        
  def self.up
    create_table :stuffs { |t| t.boolean  :is_awesome }
    end                                                                         
                                                                                
                        
  end
end

MRI
=========
>> Stuff.new
=> #<Stuff id: nil, is_awesome: nil >

JRuby
=========
>> Stuff.new
=> #<Stuff id: nil, is_awesome: false >


Wasn't sure which test case to include this in.  
test/jdbc_adapter/jdbc_postgre_test.rb doesn't exist... so should one be 
started ?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to