aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/type/string.rb
blob: 55f0e1ee1c916a9bbf96cb742b653fc07f110e9c (plain) (tree)
1
2
3
4
5
6
7
8






                                    
 



                 



                  








                             



         
module ActiveRecord
  module ConnectionAdapters
    module Type
      class String < Value # :nodoc:
        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
end