Class: ActiveRecord::HierarchicalQuery::CTE::NonRecursiveTerm

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/hierarchical_query/cte/non_recursive_term.rb

Constant Summary collapse

DISALLOWED_CLAUSES =
:order, :limit, :offset, :group, :having

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(builder) ⇒ NonRecursiveTerm

Returns a new instance of NonRecursiveTerm.



13
14
15
# File 'lib/active_record/hierarchical_query/cte/non_recursive_term.rb', line 13

def initialize(builder)
  @builder = builder
end

Instance Attribute Details

#builderObject (readonly)

Returns the value of attribute builder.



9
10
11
# File 'lib/active_record/hierarchical_query/cte/non_recursive_term.rb', line 9

def builder
  @builder
end

Instance Method Details

#arelObject



27
28
29
30
31
# File 'lib/active_record/hierarchical_query/cte/non_recursive_term.rb', line 27

def arel
  arel = scope.arel

  builder.cycle_detector.apply_to_non_recursive(arel)
end

#bind_valuesObject



18
19
20
# File 'lib/active_record/hierarchical_query/cte/non_recursive_term.rb', line 18

def bind_values
  scope.bound_attributes
end