Class: ActiveRecord::HierarchicalQuery::CTE::UnionTerm
- Inherits:
-
Object
- Object
- ActiveRecord::HierarchicalQuery::CTE::UnionTerm
- Defined in:
- lib/active_record/hierarchical_query/cte/union_term.rb
Instance Method Summary collapse
- #arel ⇒ Object
- #bind_values ⇒ Object
-
#initialize(builder, options = {}) ⇒ UnionTerm
constructor
A new instance of UnionTerm.
Constructor Details
#initialize(builder, options = {}) ⇒ UnionTerm
Returns a new instance of UnionTerm.
9 10 11 12 |
# File 'lib/active_record/hierarchical_query/cte/union_term.rb', line 9 def initialize(builder, = {}) @builder = builder @union_type = .fetch(:union_type, :all) end |
Instance Method Details
#arel ⇒ Object
26 27 28 |
# File 'lib/active_record/hierarchical_query/cte/union_term.rb', line 26 def arel non_recursive_term.arel.union(union_type, recursive_term.arel) end |
#bind_values ⇒ Object
15 16 17 |
# File 'lib/active_record/hierarchical_query/cte/union_term.rb', line 15 def bind_values non_recursive_term.bind_values + recursive_term.bind_values end |