Skip to content

Instantly share code, notes, and snippets.

@nbrew
Last active August 29, 2015 14:15
Show Gist options
  • Save nbrew/45bcf60c69424f0dc56c to your computer and use it in GitHub Desktop.
Save nbrew/45bcf60c69424f0dc56c to your computer and use it in GitHub Desktop.
Monkey Patch for rails 3 and sqlite3 boolean fields
# config/initializers/rails3_sqlite3_adapter_patch.rb
# source: http://stackoverflow.com/a/20339198/2141283
require 'active_record/connection_adapters/sqlite_adapter'
module ActiveRecord
module ConnectionAdapters
class SQLite3Adapter < SQLiteAdapter
def quoted_true; '1' end
def quoted_false; '0' end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment