Module: Goldiloader::AssociationLoader

Extended by:
AssociationLoader
Included in:
AssociationLoader
Defined in:
lib/goldiloader/association_loader.rb

Instance Method Summary collapse

Instance Method Details

#load(model, association_name) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/goldiloader/association_loader.rb', line 7

def load(model, association_name)
  models = model.auto_include_context.models.select do |peer|
    load?(peer, association_name)
  end

  eager_load(models, association_name)
end