Class: ActiveRecordExtended::QueryMethods::WithCTE::WithChain

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record_extended/query_methods/with_cte.rb

Instance Method Summary collapse

Constructor Details

#initialize(scope) ⇒ WithChain

Returns a new instance of WithChain.

Parameters:

  • scope (ActiveRecord::Relation)


66
67
68
69
# File 'lib/active_record_extended/query_methods/with_cte.rb', line 66

def initialize(scope)
  @scope       = scope
  @scope.cte ||= WithCTE.new(scope)
end

Instance Method Details

#recursive(args) ⇒ Object

Parameters:



72
73
74
75
76
77
# File 'lib/active_record_extended/query_methods/with_cte.rb', line 72

def recursive(args)
  @scope.tap do |scope|
    scope.recursive_value = true
    scope.cte.pipe_cte_with!(args)
  end
end