lib/mongoid/extensions/big_decimal.rb
# Convert the object from its mongo friendly ruby type to this type.
#
# @example Demongoize the object.
#   Object.demongoize(object)
#
# @param [ Object ] object The object to demongoize.
#
# @return [ BigDecimal, nil ] A BigDecimal derived from the object or nil.
Convert the object from its mongo friendly ruby type to this type.
Convert the object from its mongo friendly ruby type to this type .
def demongoize(object)
          unless object.nil?
            if object.is_a?(BSON::Decimal128)
              object.to_big_decimal
            elsif object.numeric?
              BigDecimal(object.to_s)
            end
          end
        end
def demongoize ( object ) unless object . nil? if object . is_a? ( BSON :: Decimal128 ) object . to_big_decimal elsif object . numeric? BigDecimal ( object . to_s ) end end end
Convert the object from its mongo friendly ruby type to this type.
Convert the object from its mongo friendly ruby type to this type .
A BigDecimal derived from the object or nil.
A BigDecimal derived from the object or nil .
 BigDecimal, nil 
object
<not_specific>
<not_specific>
object The object to demongoize.
object The object to demongoize .
example
Demongoize the object. Object.demongoize(object)
Demongoize the object . Object . demongoize ( object )