Module: Mongoid::Extensions::Integer::ClassMethods
- Defined in:
- lib/mongoid/extensions/integer.rb
Instance Method Summary collapse
-
#mongoize(object) ⇒ String
(also: #demongoize)
Turn the object from the ruby type we deal with to a Mongo friendly type.
Instance Method Details
#mongoize(object) ⇒ String Also known as: demongoize
Turn the object from the ruby type we deal with to a Mongo friendly type.
46 47 48 49 50 51 52 |
# File 'lib/mongoid/extensions/integer.rb', line 46 def mongoize(object) unless object.blank? __numeric__(object).to_i rescue 0 else nil end end |