Module: ActiveRecord::HierarchicalQuery
- Defined in:
- lib/active_record/hierarchical_query.rb,
lib/active_record/hierarchical_query/query.rb,
lib/active_record/hierarchical_query/version.rb,
lib/active_record/hierarchical_query/orderings.rb,
lib/active_record/hierarchical_query/cte/columns.rb,
lib/active_record/hierarchical_query/join_builder.rb,
lib/active_record/hierarchical_query/cte/union_term.rb,
lib/active_record/hierarchical_query/cte/query_builder.rb,
lib/active_record/hierarchical_query/cte/cycle_detector.rb,
lib/active_record/hierarchical_query/cte/recursive_term.rb,
lib/active_record/hierarchical_query/cte/non_recursive_term.rb
Defined Under Namespace
Modules: CTE Classes: JoinBuilder, Orderings, Query
Constant Summary collapse
- DELEGATOR_SCOPE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
ActiveRecord::VERSION::STRING < '4.0.0' ? :scoped : :all
- VERSION =
'1.4.5'
Instance Method Summary collapse
-
#join_recursive(join_options = {}) {|query| ... } ⇒ Object
Performs a join to recursive subquery which should be built within a block.
Instance Method Details
#join_recursive(join_options = {}) {|query| ... } ⇒ Object
Performs a join to recursive subquery which should be built within a block.
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/active_record/hierarchical_query.rb', line 31 def join_recursive( = {}, &block) raise ArgumentError, 'block expected' unless block_given? query = Query.new(klass) if block.arity == 0 query.instance_eval(&block) else block.call(query) end query.join_to(self, ) end |