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


                           
                           


                  



                             




                                               
           



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

        private

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