Module: Mongoid::Associations

Defined in:
lib/mongoid/associations.rb,
lib/mongoid/associations/proxy.rb,
lib/mongoid/associations/has_one.rb,
lib/mongoid/associations/options.rb,
lib/mongoid/associations/has_many.rb,
lib/mongoid/associations/meta_data.rb,
lib/mongoid/associations/belongs_to.rb,
lib/mongoid/associations/has_one_related.rb,
lib/mongoid/associations/has_many_related.rb,
lib/mongoid/associations/belongs_to_related.rb

Overview

:nodoc:

Defined Under Namespace

Modules: ClassMethods, InstanceMethods, Proxy Classes: BelongsTo, BelongsToRelated, HasMany, HasManyRelated, HasOne, HasOneRelated, MetaData, Options

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/mongoid/associations.rb', line 14

def self.included(base)
  base.class_eval do
    # Associations need to inherit down the chain.
    class_inheritable_accessor :associations
    self.associations = {}

    include InstanceMethods
    extend ClassMethods
  end
end