Module: Sequel::Model::Associations

Defined in:
lib/sequel/model/associations.rb

Overview

Associations are used in order to specify relationships between model classes that reflect relations between tables in the database using foreign keys.

Defined Under Namespace

Modules: AssociationDatasetMethods, ClassMethods, DatasetMethods, InstanceMethods, SingularAssociationReflection Classes: AssociationReflection, EagerGraphLoader, ManyToManyAssociationReflection, ManyToOneAssociationReflection, OneThroughOneAssociationReflection, OneToManyAssociationReflection, OneToOneAssociationReflection

Constant Summary collapse

ASSOCIATION_TYPES =

Map of association type symbols to association reflection classes.

{}

Class Method Summary collapse

Class Method Details

.apply(model) ⇒ Object

Set an empty association reflection hash in the model



12
13
14
15
16
17
18
19
# File 'lib/sequel/model/associations.rb', line 12

def self.apply(model)
  model.instance_eval do
    @association_reflections = {}
    @autoreloading_associations = {}
    @cache_associations = true
    @default_association_options = {}
  end
end