Class: Torque::PostgreSQL::AuxiliaryStatement::Recursive
- Inherits:
-
Torque::PostgreSQL::AuxiliaryStatement
- Object
- Torque::PostgreSQL::AuxiliaryStatement
- Torque::PostgreSQL::AuxiliaryStatement::Recursive
- Defined in:
- lib/torque/postgresql/auxiliary_statement/recursive.rb
Constant Summary
Constants inherited from Torque::PostgreSQL::AuxiliaryStatement
Instance Attribute Summary
Attributes inherited from Torque::PostgreSQL::AuxiliaryStatement
#bound_attributes, #join_sources
Instance Method Summary collapse
-
#initialize(**options) ⇒ Recursive
constructor
Setup any additional option in the recursive mode.
Methods inherited from Torque::PostgreSQL::AuxiliaryStatement
arel_query?, #build, build, configurator, configure, create, instantiate, lookup, relation_query?, table
Constructor Details
#initialize(**options) ⇒ Recursive
Setup any additional option in the recursive mode
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/torque/postgresql/auxiliary_statement/recursive.rb', line 8 def initialize(*, **) super @connect = [:connect]&.to_a&.first @union_all = [:union_all] @sub_query = [:sub_query] if .key?(:with_depth) @depth = [:with_depth].values_at(:name, :start, :as) @depth[0] ||= 'depth' end if .key?(:with_path) @path = [:with_path].values_at(:name, :source, :as) @path[0] ||= 'path' end end |