Class: ActiveRecordQuery::Base
- Inherits:
-
Object
- Object
- ActiveRecordQuery::Base
- Includes:
- Conditionable, Featureable, Groupable, Havingable, Identifiable, Joinable, Limitable, Offsetable, Orderable, Selectable
- Defined in:
- lib/activerecord-query.rb
Overview
The base class collects all the activerecord query features and the execute method processes all the features. The api user must inherit from this class in order to build a new query definition.
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
Methods included from Conditionable
Methods included from Havingable
Methods included from Offsetable
Methods included from Groupable
Methods included from Joinable
Methods included from Limitable
Methods included from Orderable
Methods included from Selectable
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
32 33 34 |
# File 'lib/activerecord-query.rb', line 32 def initialize( = {}) @options = end |
Class Method Details
.execute(options = {}) ⇒ Object
27 28 29 |
# File 'lib/activerecord-query.rb', line 27 def execute( = {}) new().execute end |
Instance Method Details
#execute ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/activerecord-query.rb', line 36 def execute query = resource.all self.class._query_features.each do |query_feature| query = send(query_feature, query) end query end |