module BabySqueel::ActiveRecord::QueryMethods
Public Instance Methods
grouping(&block)
click to toggle source
Constructs Arel for ActiveRecord::QueryMethods#group using the DSL
.
# File lib/baby_squeel/active_record/query_methods.rb, line 28 def grouping(&block) group DSL.evaluate(self, &block) end
joining(&block)
click to toggle source
Constructs Arel for ActiveRecord::QueryMethods#joins using the DSL
.
# File lib/baby_squeel/active_record/query_methods.rb, line 8 def joining(&block) joins DSL.evaluate(self, &block) end
ordering(&block)
click to toggle source
Constructs Arel for ActiveRecord::QueryMethods#order using the DSL
.
# File lib/baby_squeel/active_record/query_methods.rb, line 18 def ordering(&block) order DSL.evaluate(self, &block) end
reordering(&block)
click to toggle source
Constructs Arel for ActiveRecord::QueryMethods#reorder using the DSL
.
# File lib/baby_squeel/active_record/query_methods.rb, line 23 def reordering(&block) reorder DSL.evaluate(self, &block) end
selecting(&block)
click to toggle source
Constructs Arel for ActiveRecord::QueryMethods#select using the DSL
.
# File lib/baby_squeel/active_record/query_methods.rb, line 13 def selecting(&block) select DSL.evaluate(self, &block) end
when_having(&block)
click to toggle source
Constructs Arel for ActiveRecord::QueryMethods#having using the DSL
.
# File lib/baby_squeel/active_record/query_methods.rb, line 33 def when_having(&block) having DSL.evaluate(self, &block) end
Private Instance Methods
build_joins(manager, joins, aliases)
click to toggle source
This is a monkey patch, and I'm not happy about it. Active Record will call `group_by` on the `joins`. The Injector has a custom `group_by` method that handles BabySqueel::Join
nodes.
Calls superclass method
# File lib/baby_squeel/active_record/query_methods.rb, line 43 def build_joins(manager, joins, aliases) super manager, BabySqueel::JoinDependency::Injector.new(joins), aliases end