Module: BabySqueel::ActiveRecord::QueryMethods

Defined in:
lib/baby_squeel/active_record/query_methods.rb

Defined Under Namespace

Modules: Injector6_1

Instance Method Summary collapse

Instance Method Details

#construct_join_dependency(associations, join_type) ⇒ Object



54
55
56
57
58
59
60
# File 'lib/baby_squeel/active_record/query_methods.rb', line 54

def construct_join_dependency(associations, join_type)
  result = super(associations, join_type)
  if associations.any? { |assoc| assoc.is_a?(BabySqueel::Join) }
    result.extend(BabySqueel::JoinDependency::Injector6_1)
  end
  result
end

#grouping(&block) ⇒ Object

Constructs Arel for ActiveRecord::QueryMethods#group using the DSL.



45
46
47
# File 'lib/baby_squeel/active_record/query_methods.rb', line 45

def grouping(&block)
  group DSL.evaluate(self, &block)
end

#joining(&block) ⇒ Object

Constructs Arel for ActiveRecord::QueryMethods#joins using the DSL.



25
26
27
# File 'lib/baby_squeel/active_record/query_methods.rb', line 25

def joining(&block)
  joins DSL.evaluate(self, &block)
end

#ordering(&block) ⇒ Object

Constructs Arel for ActiveRecord::QueryMethods#order using the DSL.



35
36
37
# File 'lib/baby_squeel/active_record/query_methods.rb', line 35

def ordering(&block)
  order DSL.evaluate(self, &block)
end

#reordering(&block) ⇒ Object

Constructs Arel for ActiveRecord::QueryMethods#reorder using the DSL.



40
41
42
# File 'lib/baby_squeel/active_record/query_methods.rb', line 40

def reordering(&block)
  reorder DSL.evaluate(self, &block)
end

#selecting(&block) ⇒ Object

Constructs Arel for ActiveRecord::QueryMethods#select using the DSL.



30
31
32
# File 'lib/baby_squeel/active_record/query_methods.rb', line 30

def selecting(&block)
  select DSL.evaluate(self, &block)
end

#when_having(&block) ⇒ Object

Constructs Arel for ActiveRecord::QueryMethods#having using the DSL.



50
51
52
# File 'lib/baby_squeel/active_record/query_methods.rb', line 50

def when_having(&block)
  having DSL.evaluate(self, &block)
end