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

Defined in:
lib/mongoid/extensions/object_id.rb

Instance Method Summary (collapse)

Instance Method Details

- (BSON::ObjectId) evolve(object)

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

Examples:

Evolve the object.

ObjectId.evolve(id)

Since:

  • 3.0.0



31
32
33
# File 'lib/mongoid/extensions/object_id.rb', line 31

def evolve(object)
  object.__evolve_object_id__
end

- (BSON::ObjectId) mongoize(object)

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

Examples:

Convert the object.

ObjectId.mongoize(id)

Since:

  • 3.0.0



45
46
47
# File 'lib/mongoid/extensions/object_id.rb', line 45

def mongoize(object)
  object.__mongoize_object_id__
end