Skip to content

Instantly share code, notes, and snippets.

@ajoman
Created March 6, 2014 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajoman/9391708 to your computer and use it in GitHub Desktop.
Save ajoman/9391708 to your computer and use it in GitHub Desktop.
Compatibility in Rails 4 for SQLite3 boolean columns. Add it to config/initializers folder.
# config/initializers/sqlite3_adapter_patch.rb
module ActiveRecord
module ConnectionAdapters
class SQLite3Adapter < AbstractAdapter
QUOTED_TRUE, QUOTED_FALSE = "'t'", "'f'"
def quoted_true
QUOTED_TRUE
end
def quoted_false
QUOTED_FALSE
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment