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



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

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.



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

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

#joining(&block) ⇒ Object

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



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

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

#ordering(&block) ⇒ Object

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



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

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

#reordering(&block) ⇒ Object

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



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

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

#selecting(&block) ⇒ Object

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



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

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

#when_having(&block) ⇒ Object

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



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

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