Module: ActiveGraphExtensions::Node::Query::QueryProxyEagerLoading

Extended by:
ActiveSupport::Concern
Includes:
AssociationLimiting, EagerLoadingOrder, ScopeEagerLoading
Defined in:
lib/active_graph_extensions/node/query/query_proxy_eager_loading.rb,
lib/active_graph_extensions/node/query/query_proxy_eager_loading/enhanced_tree.rb,
lib/active_graph_extensions/node/query/query_proxy_eager_loading/eager_loading_order.rb,
lib/active_graph_extensions/node/query/query_proxy_eager_loading/scope_eager_loading.rb,
lib/active_graph_extensions/node/query/query_proxy_eager_loading/association_limiting.rb,
lib/active_graph_extensions/node/query/query_proxy_eager_loading/association_eager_load.rb

Defined Under Namespace

Modules: AssociationEagerLoad, AssociationLimiting, EagerLoadingOrder, ScopeEagerLoading Classes: EnhancedTree

Instance Method Summary collapse

Methods included from EagerLoadingOrder

#nested_order_clause, #optional_order, #order_clause, #order_clause_for_query, #skip_order?

Methods included from ScopeEagerLoading

#assign_config_chain, #authorized_rel, #authorized_scope, #properties_for, #proxy_rel_parts, #relationship_model

Methods included from AssociationLimiting

included

Instance Method Details

#association_tree_classObject



10
11
12
# File 'lib/active_graph_extensions/node/query/query_proxy_eager_loading.rb', line 10

def association_tree_class
  EnhancedTree
end

#firstObject



23
24
25
# File 'lib/active_graph_extensions/node/query/query_proxy_eager_loading.rb', line 23

def first
  limit(1).to_a.first
end

#with_associations(*spec) ⇒ Object



33
34
35
36
37
38
# File 'lib/active_graph_extensions/node/query/query_proxy_eager_loading.rb', line 33

def with_associations(*spec)
  new_link.tap do |new_query_proxy|
    new_query_proxy.with_associations_tree = with_associations_tree.clone
    new_query_proxy.with_associations_tree.add_spec_and_validate(spec)
  end
end

#with_ordered_associations(spec, order, opts = {}) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/active_graph_extensions/node/query/query_proxy_eager_loading.rb', line 14

def with_ordered_associations(spec, order, opts = {})
  @max_page_size = opts[:max_page_size]
  @paginate = opts[:paginate]
  @with_vars = opts[:with_vars]
  @order_spec = order.with_indifferent_access unless spec.empty?
  @opts = opts
  with_associations(spec)
end