I have boolean column in my DB (.sqlite3). It may be 't' or 'f'.
t.boolean :disable_product_category
How can I change the value to 1 or 0?
EDIT: I find this Rails 3 SQLite3 Boolean false
I edit active_record/connection_adapters/abstract/quoting.rb.
if column && column.type == :integer
value ? 1 : 0
else
value ? 't' : 'f'
end
After replaced 't' and 'f' to 1 and 0, all work as I want.
Is that normal solution? I want use this:
# 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
But it is not work :(. Is it need update the application somehow?