aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/type/float.rb
blob: 28111e9d8e5160a22ce71d455d664f00289c9cd5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module ActiveRecord
  module ConnectionAdapters
    module Type
      class Float < Value # :nodoc:
        include Numeric

        def type
          :float
        end

        def klass
          ::Float
        end

        alias type_cast_for_database type_cast

        private

        def cast_value(value)
          value.to_f
        end
      end
    end
  end
end