123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Extended In:
Defined in: lib/mongoid/extensions/object_id.rb

Instance Method Summary

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:

[ GitHub ]

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

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:

[ GitHub ]

  
# File 'lib/mongoid/extensions/object_id.rb', line 43

def mongoize(object)
  object.__mongoize_object_id__
end