diff options
Diffstat (limited to 'activerecord/lib/active_record/type/float.rb')
-rw-r--r-- | activerecord/lib/active_record/type/float.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/type/float.rb b/activerecord/lib/active_record/type/float.rb new file mode 100644 index 0000000000..42eb44b9a9 --- /dev/null +++ b/activerecord/lib/active_record/type/float.rb @@ -0,0 +1,19 @@ +module ActiveRecord + module Type + class Float < Value # :nodoc: + include Numeric + + def type + :float + end + + alias type_cast_for_database type_cast + + private + + def cast_value(value) + value.to_f + end + end + end +end |