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.
-
1consider using the same database for both development and production, there is no reason not to reallyhouse9– house92013-10-15 15:46:36 +00:00Commented Oct 15, 2013 at 15:46
-
1Has ActiveRecord fixed its boolean brain damage with SQLite? SQLite certainly thinks that booleans are C-style numbers but ActiveRecord hasn't always done so with SQLite. Anyway, stop smashing your own head with a brick and start developing on top of PostgreSQL if that's what you're deploying on, building a non-trivial database-portable application is very difficult and no ORM will protect you from the subtle differences.mu is too short– mu is too short2013-10-15 16:06:19 +00:00Commented Oct 15, 2013 at 16:06
Add a comment
|