Created
June 23, 2016 08:53
-
-
Save ameuret/50e180e8982cac56b597deacbe8e0a14 to your computer and use it in GitHub Desktop.
Unexpected boolean results with Sequel 4.34.0 (sqlite)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@DB.create_table(:persons) do | |
String :name | |
String :badge | |
String :orig_photo # This is our primary key | |
Integer :center_x | |
Integer :center_y | |
Integer :crop_width | |
Boolean :preferred | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB.schema(:persons)[6] | |
[:preferred, | |
{:allow_null=>true, | |
:default=>nil, | |
:db_type=>"Boolean", | |
:primary_key=>false, | |
:type=>:boolean, | |
:ruby_default=>nil}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB[:persons].exclude(preferred:false) | |
{:name=>"CHARLOTTE DE SEREVILLE", :badge=>"AFEDDAC", :orig_photo=>"DIP_8457.JPG", :center_x=>491, :center_y=>395, :crop_width=>908, :preferred=>false}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment