Module: MongoModel::Associations

Extended by:
ActiveSupport::Concern
Included in:
EmbeddedDocument
Defined in:
lib/mongomodel.rb,
lib/mongomodel/concerns/associations.rb,
lib/mongomodel/concerns/associations/base/proxy.rb,
lib/mongomodel/concerns/associations/belongs_to.rb,
lib/mongomodel/concerns/associations/base/definition.rb,
lib/mongomodel/concerns/associations/has_many_by_ids.rb,
lib/mongomodel/concerns/associations/base/association.rb,
lib/mongomodel/concerns/associations/has_many_by_foreign_key.rb

Defined Under Namespace

Modules: Base, ClassMethods Classes: BelongsTo, HasManyByForeignKey, HasManyByIds

Instance Method Summary collapse

Instance Method Details

#associationsObject


5
6
7
8
9
10
# File 'lib/mongomodel/concerns/associations.rb', line 5

def associations
  @_associations ||= self.class.associations.inject({}) do |result, (name, association)|
    result[name] = association.for(self)
    result
  end
end