module Mongoid::Extensions::ObjectId::ClassMethods

Public Instance Methods

evolve(object) click to toggle source

Evolve the object into a mongo-friendly value to query with.

@example Evolve the object.

ObjectId.evolve(id)

@param [ Object ] object The object to evolve.

@return [ BSON::ObjectId ] The object id.

@since 3.0.0

# File lib/mongoid/extensions/object_id.rb, line 33
def evolve(object)
  object.__evolve_object_id__
end
mongoize(object) click to toggle source

Convert the object into a mongo-friendly value to store.

@example Convert the object.

ObjectId.mongoize(id)

@param [ Object ] object The object to convert.

@return [ BSON::ObjectId ] The object id.

@since 3.0.0

# File lib/mongoid/extensions/object_id.rb, line 47
def mongoize(object)
  object.__mongoize_object_id__
end