Class: BabySqueel::JoinDependency::Injector

Inherits:
Array
  • Object
show all
Defined in:
lib/baby_squeel/join_dependency/injector.rb

Overview

This class allows BabySqueel to slip custom joins_values into Active Record’s JoinDependency

Instance Method Summary collapse

Instance Method Details

#group_byObject

Active Record will call group_by on this object in ActiveRecord::QueryMethods#build_joins. This allows BabySqueel::JoinExpressions to be treated like typical join hashes until Polyamorous can deal with them.



11
12
13
14
15
16
17
18
19
20
# File 'lib/baby_squeel/join_dependency/injector.rb', line 11

def group_by
  super do |join|
    case join
    when BabySqueel::JoinExpression
      :association_join
    else
      yield join
    end
  end
end