Reputation: 42380
I have a ruby on rails application where I am using SQLite for development and testing, and I am using PostgreSQL in production. How can I write queries that handle booleans in my models that can handle both cases? SQLite handles booleans by using 0
and 1
, and PostgreSQL uses t
and f
, which is causing my problems.
Upvotes: 0
Views: 47
Reputation: 9701
Just use true
/false
. ActiveRecord will handle the rest.
So for example: Post.where(published: true)
Upvotes: 2