Module: BabySqueel::ActiveRecord::QueryMethods
- Defined in:
- lib/baby_squeel/active_record/query_methods.rb
Defined Under Namespace
Modules: Injector6_1
Instance Method Summary collapse
- #construct_join_dependency(associations, join_type) ⇒ Object
-
#grouping(&block) ⇒ Object
Constructs Arel for ActiveRecord::QueryMethods#group using the DSL.
-
#joining(&block) ⇒ Object
Constructs Arel for ActiveRecord::QueryMethods#joins using the DSL.
-
#ordering(&block) ⇒ Object
Constructs Arel for ActiveRecord::QueryMethods#order using the DSL.
-
#reordering(&block) ⇒ Object
Constructs Arel for ActiveRecord::QueryMethods#reorder using the DSL.
-
#selecting(&block) ⇒ Object
Constructs Arel for ActiveRecord::QueryMethods#select using the DSL.
-
#when_having(&block) ⇒ Object
Constructs Arel for ActiveRecord::QueryMethods#having using the DSL.
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 |