aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/lib/active_record/type/boolean.rb
blob: 06dd17ed28e084c88c761cdee18854982a2e4668 (plain) (tree)


















                                                                 
module ActiveRecord
  module Type
    class Boolean < Value # :nodoc:
      def type
        :boolean
      end

      private

      def cast_value(value)
        if value == ''
          nil
        else
          ConnectionAdapters::Column::TRUE_VALUES.include?(value)
        end
      end
    end
  end
end