Module: Mongoid::Extensions::ObjectId::ClassMethods

Defined in:
build/mongoid-master/lib/mongoid/extensions/object_id.rb

Instance Method Summary collapse

Instance Method Details

#evolve(object) ⇒ BSON::ObjectId

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

Examples:

Evolve the object.

ObjectId.evolve(id)

Parameters:

  • object (Object)

    The object to evolve.

Returns:

Since:

  • 3.0.0



33
34
35
# File 'build/mongoid-master/lib/mongoid/extensions/object_id.rb', line 33

def evolve(object)
  object.__evolve_object_id__
end

#mongoize(object) ⇒ BSON::ObjectId

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

Examples:

Convert the object.

ObjectId.mongoize(id)

Parameters:

  • object (Object)

    The object to convert.

Returns:

Since:

  • 3.0.0



47
48
49
# File 'build/mongoid-master/lib/mongoid/extensions/object_id.rb', line 47

def mongoize(object)
  object.__mongoize_object_id__
end