Method: ActiveRecord::Associations::Preloader::ThroughAssociation#runnable_loaders

Defined in:
activerecord/lib/active_record/associations/preloader/through_association.rb

#runnable_loadersObject



39
40
41
42
43
44
45
46
47
# File 'activerecord/lib/active_record/associations/preloader/through_association.rb', line 39

def runnable_loaders
  if data_available?
    [self]
  elsif through_preloaders.all?(&:run?)
    source_preloaders.flat_map(&:runnable_loaders)
  else
    through_preloaders.flat_map(&:runnable_loaders)
  end
end