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