Module: ActsAsRecursiveTree::Builders::Strategies

Defined in:
lib/acts_as_recursive_tree/builders/strategies.rb,
lib/acts_as_recursive_tree/builders/strategies/join.rb,
lib/acts_as_recursive_tree/builders/strategies/ancestor.rb,
lib/acts_as_recursive_tree/builders/strategies/subselect.rb,
lib/acts_as_recursive_tree/builders/strategies/descendant.rb

Overview

Strategy module for different strategies of how to build the resulting query.

Defined Under Namespace

Modules: Ancestor, Descendant, Join, Subselect

Class Method Summary collapse

Class Method Details

.for_query_options(query_opts) ⇒ Object

Returns a Strategy appropriate for query_opts

Parameters:

Returns:

  • a strategy class best suited for the opts



15
16
17
18
19
20
21
# File 'lib/acts_as_recursive_tree/builders/strategies.rb', line 15

def self.for_query_options(query_opts)
  if query_opts.ensure_ordering || query_opts.query_strategy == :join
    Join
  else
    Subselect
  end
end