lib/rails/graphql/source/active_record_source.rb
# Preload the records for a given +association+ using the current value.
# It can be further specified with a given +scope+
Preload the records for a given +association+ using the current value.
It can be further specified with a given +scope+
Preload the records for a given + association + using the current value . It can be further specified with a given + scope +
def preload(association, scope = nil)
          reflection = model._reflect_on_association(association)
          records = current_value.is_a?(preloader_association) \
            ? current_value.preloaded_records \
            : Array.wrap(current_value.itself).compact
          ar_preloader.send(:preloaders_for_reflection, reflection, records, scope).first
        end
def preload ( association , scope = nil ) reflection = model . _reflect_on_association ( association ) records = current_value . is_a? ( preloader_association ) ? current_value . preloaded_records : Array . wrap ( current_value . itself ) . compact ar_preloader . send ( :preloaders_for_reflection , reflection , records , scope ) . first end
Preload the records for a given +association+ using the current value.
Preload the records for a given + association + using the current value .
association
scope