Module: Mongoid::Relations::Macros

Extended by:
ActiveSupport::Concern
Included in:
Mongoid::Relations
Defined in:
lib/mongoid/relations/macros.rb

Overview

This module contains the core macros for defining relations between documents. They can be either embedded or referenced (relational).

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#relationsHash<String, Metadata> Also known as: associations

Note:

Refactored from using delegate for class load performance.

Get the metadata for all the defined relations.

Examples:

Get the relations.

model.relations

Returns:



34
35
36
# File 'lib/mongoid/relations/macros.rb', line 34

def relations
  self.class.relations
end