diff options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/type/string.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/type/string.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/type/string.rb b/activerecord/lib/active_record/connection_adapters/type/string.rb index 0feb4299f5..55f0e1ee1c 100644 --- a/activerecord/lib/active_record/connection_adapters/type/string.rb +++ b/activerecord/lib/active_record/connection_adapters/type/string.rb @@ -5,6 +5,24 @@ module ActiveRecord def type :string end + + def text? + true + end + + def klass + ::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 |