Skip to content

Instantly share code, notes, and snippets.

@ameuret
Created June 23, 2016 08:53
Show Gist options
  • Save ameuret/50e180e8982cac56b597deacbe8e0a14 to your computer and use it in GitHub Desktop.
Save ameuret/50e180e8982cac56b597deacbe8e0a14 to your computer and use it in GitHub Desktop.
Unexpected boolean results with Sequel 4.34.0 (sqlite)
@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
DB.schema(:persons)[6]
[:preferred,
{:allow_null=>true,
:default=>nil,
:db_type=>"Boolean",
:primary_key=>false,
:type=>:boolean,
:ruby_default=>nil}]
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