Class/Module Index [+]

Quicksearch

Mongoid::Extensions::Integer::ClassMethods

Public Instance Methods

demongoize(object) click to toggle source
Alias for: mongoize
mongoize(object) click to toggle source

Turn the object from the ruby type we deal with to a Mongo friendly type.

@example Mongoize the object.

BigDecimal.mongoize("123.11")

@return [ String ] The object mongoized.

@since 3.0.0

# File lib/mongoid/extensions/integer.rb, line 52
def mongoize(object)
  unless object.blank?
    __numeric__(object).to_i rescue 0
  else
    nil
  end
end
Also aliased as: demongoize

[Validate]

Generated with the Darkfish Rdoc Generator 2.