Class: Decidim::Consultations::OrganizationQuestions

Inherits:
Query
  • Object
show all
Defined in:
app/queries/decidim/consultations/organization_questions.rb

Overview

This query class filters all questions given an organization.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(organization) ⇒ OrganizationQuestions

Returns a new instance of OrganizationQuestions.



11
12
13
# File 'app/queries/decidim/consultations/organization_questions.rb', line 11

def initialize(organization)
  @organization = organization
end

Class Method Details

.for(organization) ⇒ Object



7
8
9
# File 'app/queries/decidim/consultations/organization_questions.rb', line 7

def self.for(organization)
  new(organization).query
end

Instance Method Details

#queryObject



15
16
17
# File 'app/queries/decidim/consultations/organization_questions.rb', line 15

def query
  Decidim::Consultations::Question.where(organization: @organization)
end