lib/rails/graphql/source/active_record_source.rb
# Collect a scope for filters applied to a given association
Collect a scope for filters applied to a given association
Collect a scope for filters applied to a given association
def build_association_scope(association)
        scope = model._reflect_on_association(association).klass.default_scoped
        proxied = event.field.try(:proxied_owner)
        scope = event.on_instance(proxied) do |instance|
          instance.inject_scopes(scope, :relation)
        end if proxied.present? && proxied <= Source::ActiveRecordSource
        inject_scopes(scope, :relation)
      end
def build_association_scope ( association ) scope = model . _reflect_on_association ( association ) . klass . default_scoped proxied = event . field . try ( :proxied_owner ) scope = event . on_instance ( proxied ) do | instance | instance . inject_scopes ( scope , :relation ) end if proxied . present? && proxied <= Source :: ActiveRecordSource inject_scopes ( scope , :relation ) end
Collect a scope for filters applied to a given association
Collect a scope for filters applied to a given association
# Apply proxied injected scopes # Apply self defined injected scopes
association