Module: Mongoid::Extensions::Float::ClassMethods
- Defined in:
- lib/mongoid/extensions/float.rb
Instance Method Summary collapse
-
#mongoize(object) ⇒ String
Turn the object from the ruby type we deal with to a Mongo friendly type.
Instance Method Details
#mongoize(object) ⇒ String
Turn the object from the ruby type we deal with to a Mongo friendly type.
43 44 45 46 47 48 49 |
# File 'lib/mongoid/extensions/float.rb', line 43 def mongoize(object) unless object.blank? __numeric__(object).to_f rescue 0.0 else nil end end |