aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/lib/active_record/type/string.rb
blob: 3b1554bd5a3cd6fccd58569db6313e197a4f5473 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                  











                           
module ActiveRecord
  module Type
    class String < Value # :nodoc:
      def type
        :string
      end

      def text?
        true
      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