The collections module is used for providing functionality around setting up and updating collections.
Get the collection for the class.
@note Defining methods instead of delegate to avoid calls to
Kernel.caller for class load performance reasons.
@example Get the collection.
person.collection
@return [ Collection ] The class collection.
@since 1.0.0
# File lib/mongoid/collections.rb, line 24 def collection self.class.collection end
Get the database for the class.
@note Defining methods instead of delegate to avoid calls to
Kernel.caller for class load performance reasons.
@example Get the database.
person.db
@return [ DB ] The class db.
@since 1.0.0
# File lib/mongoid/collections.rb, line 39 def db self.class.db end
Generated with the Darkfish Rdoc Generator 2.