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, DatasetModule, 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
20
21
22
# File 'lib/sequel/model/associations.rb', line 12

def self.apply(model)
  model.instance_exec do
    @association_reflections = {}
    @autoreloading_associations = {}
    @cache_associations = true
    @default_eager_limit_strategy = true
    @default_association_options = {}
    @default_association_type_options = {}
    @dataset_module_class = DatasetModule
  end
end