Class: Decidim::Consultations::OrganizationConsultations
- Inherits:
-
Query
- Object
- Query
- Decidim::Consultations::OrganizationConsultations
- Defined in:
- app/queries/decidim/consultations/organization_consultations.rb
Overview
This query class filters all consultations given an organization.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(organization) ⇒ OrganizationConsultations
constructor
A new instance of OrganizationConsultations.
- #query ⇒ Object
Constructor Details
#initialize(organization) ⇒ OrganizationConsultations
Returns a new instance of OrganizationConsultations.
11 12 13 |
# File 'app/queries/decidim/consultations/organization_consultations.rb', line 11 def initialize(organization) @organization = organization end |
Class Method Details
.for(organization) ⇒ Object
7 8 9 |
# File 'app/queries/decidim/consultations/organization_consultations.rb', line 7 def self.for(organization) new(organization).query end |
Instance Method Details
#query ⇒ Object
15 16 17 |
# File 'app/queries/decidim/consultations/organization_consultations.rb', line 15 def query Decidim::Consultation.where(organization: @organization) end |