Class: Decidim::ActionDelegator::ConsultationDelegations
- Inherits:
-
Query
- Object
- Query
- Decidim::ActionDelegator::ConsultationDelegations
- Defined in:
- app/queries/decidim/action_delegator/consultation_delegations.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(consultation) ⇒ ConsultationDelegations
constructor
A new instance of ConsultationDelegations.
- #query ⇒ Object
Constructor Details
#initialize(consultation) ⇒ ConsultationDelegations
Returns a new instance of ConsultationDelegations.
10 11 12 |
# File 'app/queries/decidim/action_delegator/consultation_delegations.rb', line 10 def initialize(consultation) @consultation = consultation end |
Class Method Details
.for(consultation) ⇒ Object
6 7 8 |
# File 'app/queries/decidim/action_delegator/consultation_delegations.rb', line 6 def self.for(consultation) new(consultation).query end |
Instance Method Details
#query ⇒ Object
14 15 16 17 18 |
# File 'app/queries/decidim/action_delegator/consultation_delegations.rb', line 14 def query Delegation .joins(setting: :consultation) .where(decidim_consultations: { id: consultation.id }) end |