Module: Rql::Scope::ParamMethods
- Included in:
- ParamMethodGroup, RqlScope
- Defined in:
- lib/rql/scope/param_methods.rb
Instance Method Summary collapse
-
#includes(*attributes) ⇒ Rql::Scope::RqlScope
Includes the specified associated models.
-
#joins(*attributes) ⇒ Rql::Scope::RqlScope
Joins to the specified associated models.
-
#order(*attributes) ⇒ Rql::Scope::RqlScope
Orders by specified attributes.
-
#select(*attributes) ⇒ Rql::Scope::RqlScope
Specifies attributes to be selected from the database.
-
#where(**conditions) ⇒ Rql::Scope::RqlScope
Filters scope based on specified conditions.
Instance Method Details
#includes(*attributes) ⇒ Rql::Scope::RqlScope
Includes the specified associated models
40 41 42 |
# File 'lib/rql/scope/param_methods.rb', line 40 def includes(*attributes) scope.includes(*attributes) end |
#joins(*attributes) ⇒ Rql::Scope::RqlScope
Joins to the specified associated models
32 33 34 |
# File 'lib/rql/scope/param_methods.rb', line 32 def joins(*attributes) scope.joins(*attributes) end |
#order(*attributes) ⇒ Rql::Scope::RqlScope
Orders by specified attributes
24 25 26 |
# File 'lib/rql/scope/param_methods.rb', line 24 def order(*attributes) scope.order(*build_order(attributes)) end |
#select(*attributes) ⇒ Rql::Scope::RqlScope
Specifies attributes to be selected from the database
16 17 18 |
# File 'lib/rql/scope/param_methods.rb', line 16 def select(*attributes) scope.select(*attributes.map{|attr| scope.derived_attributes[attr] ? scope.eval_rql(&scope.derived_attributes[attr]).as(attr).arel : attr}) end |
#where(**conditions) ⇒ Rql::Scope::RqlScope
Filters scope based on specified conditions
8 9 10 |
# File 'lib/rql/scope/param_methods.rb', line 8 def where(**conditions) scope.where(build_conditions(conditions)) end |