Class: Parelation::Applier
- Inherits:
-
Object
- Object
- Parelation::Applier
- Defined in:
- lib/parelation/applier.rb
Constant Summary collapse
- CRITERIA =
Returns the list of active criteria classes that are used to narrow down database results.
[ Parelation::Criteria::Select, Parelation::Criteria::Limit, Parelation::Criteria::Offset, Parelation::Criteria::Order, Parelation::Criteria::Query, Parelation::Criteria::Where, ]
Instance Attribute Summary collapse
- #chain ⇒ ActiveRecord::Relation readonly
- #params ⇒ ActionController::Parameters, Hash readonly
Instance Method Summary collapse
-
#apply ⇒ ActiveRecord::Relation
The criteria-applied #chain.
-
#initialize(chain, params) ⇒ Applier
constructor
A new instance of Applier.
Constructor Details
#initialize(chain, params) ⇒ Applier
Returns a new instance of Applier.
26 27 28 29 |
# File 'lib/parelation/applier.rb', line 26 def initialize(chain, params) @chain = chain @params = params end |
Instance Attribute Details
#chain ⇒ ActiveRecord::Relation (readonly)
17 18 19 |
# File 'lib/parelation/applier.rb', line 17 def chain @chain end |
#params ⇒ ActionController::Parameters, Hash (readonly)
21 22 23 |
# File 'lib/parelation/applier.rb', line 21 def params @params end |
Instance Method Details
#apply ⇒ ActiveRecord::Relation
Returns the criteria-applied #chain.
33 34 35 |
# File 'lib/parelation/applier.rb', line 33 def apply @apply ||= apply_to_chain end |