lib/mongoid/extensions/date.rb
def mongoize(object)
          unless object.blank?
            begin
              time = object.__mongoize_time__
              ::Time.utc(time.year, time.month, time.day)
            rescue ArgumentError
              nil
            end
          end
        end
# Turn the object from the ruby type we deal with to a Mongo friendly
# type.
#
# @example Mongoize the object.
#   Date.mongoize("2012-1-1")
#
# @param [ Object ] object The object to mongoize.
#
# @return [ Time ] The object mongoized.
#
# @since 3.0.0
Turn the object from the ruby type we deal with to a Mongo friendly
type.
Turn the object from the ruby type we deal with to a Mongo friendly type .
def mongoize(object)
          unless object.blank?
            begin
              time = object.__mongoize_time__
              ::Time.utc(time.year, time.month, time.day)
            rescue ArgumentError
              nil
            end
          end
        end
def mongoize ( object ) unless object . blank? begin time = object . __mongoize_time__ :: Time . utc ( time . year , time . month , time . day ) rescue ArgumentError nil end end end
Turn the object from the ruby type we deal with to a Mongo friendly
type.
Turn the object from the ruby type we deal with to a Mongo friendly type .
The object mongoized.
The object mongoized .
 Time 
object
object The object to mongoize.
object The object to mongoize .
example
Mongoize the object.
Mongoize the object .
since
None