class ActiveGraph::Shared::TypeConverters::BigDecimalConverter

Public Class Methods

convert_type() click to toggle source
   # File lib/active_graph/shared/type_converters.rb
74 def convert_type
75   BigDecimal
76 end
db_type() click to toggle source
   # File lib/active_graph/shared/type_converters.rb
78 def db_type
79   String
80 end
to_db(value) click to toggle source
   # File lib/active_graph/shared/type_converters.rb
82 def to_db(value)
83   case value
84   when Rational
85     value.to_f.to_d
86   when respond_to?(:to_d)
87     value.to_d
88   else
89     BigDecimal(value.to_s)
90   end.to_s
91 end
to_ruby(value) click to toggle source
   # File lib/active_graph/shared/type_converters.rb
93 def to_ruby(value)
94   value.to_d
95 end