Class: Cuprum::Rails::Actions::Middleware::Associations::Query
- Inherits:
-
Cuprum::Rails::Action
- Object
- Command
- Cuprum::Rails::Action
- Cuprum::Rails::Actions::Middleware::Associations::Query
- Includes:
- Middleware
- Defined in:
- lib/cuprum/rails/actions/middleware/associations/query.rb
Overview
Abstract middleware for performing an association query.
Instance Attribute Summary collapse
-
#association ⇒ Cuprum::Collections::Association
readonly
The association.
-
#association_type ⇒ String, Symbol
readonly
The type of association.
Attributes inherited from Cuprum::Rails::Action
Instance Method Summary collapse
-
#initialize(association_type: nil, **association_params) ⇒ Query
constructor
A new instance of Query.
Methods inherited from Cuprum::Rails::Action
Constructor Details
#initialize(association_type: nil, **association_params) ⇒ Query
Returns a new instance of Query.
17 18 19 20 21 22 |
# File 'lib/cuprum/rails/actions/middleware/associations/query.rb', line 17 def initialize(association_type: nil, **association_params) super() @association_type = association_type&.intern @association = build_association(**association_params) end |
Instance Attribute Details
#association ⇒ Cuprum::Collections::Association (readonly)
Returns the association.
25 26 27 |
# File 'lib/cuprum/rails/actions/middleware/associations/query.rb', line 25 def association @association end |
#association_type ⇒ String, Symbol (readonly)
Returns the type of association.
28 29 30 |
# File 'lib/cuprum/rails/actions/middleware/associations/query.rb', line 28 def association_type @association_type end |