From 36fde2b704164ac02380518350f01a17d3e0208e Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Tue, 20 May 2014 06:16:47 -0700 Subject: Delegate `#type_cast` to injected type objects on SQLite3 --- .../lib/active_record/connection_adapters/type/string.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'activerecord/lib/active_record/connection_adapters/type/string.rb') diff --git a/activerecord/lib/active_record/connection_adapters/type/string.rb b/activerecord/lib/active_record/connection_adapters/type/string.rb index 0feb4299f5..d6c1c64834 100644 --- a/activerecord/lib/active_record/connection_adapters/type/string.rb +++ b/activerecord/lib/active_record/connection_adapters/type/string.rb @@ -5,6 +5,16 @@ module ActiveRecord def type :string end + + private + + def cast_value(value) + case value + when true then "1" + when false then "0" + else value.to_s + end + end end end end -- cgit v1.2.3