Module: ActiveRecordQuery::Joinable

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/active_record_query/concerns/joinable.rb

Overview

The module defines the join and left_outer_join macros.

Defined Under Namespace

Classes: JoinedResource

Instance Method Summary collapse

Instance Method Details

#build_joins(scope) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/active_record_query/concerns/joinable.rb', line 47

def build_joins(scope)
  arg_stacker = ArgumentStacker.new(self, :join)
  arg_stacker.list.each do |join_params|
    scope = scope.joins(join_params)
  end
  scope
end

#build_left_outer_joins(scope) ⇒ Object



55
56
57
58
59
60
61
# File 'lib/active_record_query/concerns/joinable.rb', line 55

def build_left_outer_joins(scope)
  arg_stacker = ArgumentStacker.new(self, :left_outer_join)
  arg_stacker.list.each do |join_params|
    scope = scope.left_outer_joins(join_params)
  end
  scope
end