Class: Decidim::ParticipatoryProcesses::OrganizationPrioritizedParticipatoryProcesses

Inherits:
Rectify::Query
  • Object
show all
Defined in:
decidim-participatory_processes/app/queries/decidim/participatory_processes/organization_prioritized_participatory_processes.rb

Overview

This query class filters public processes given an organization and a filter in a meaningful prioritized order.

Instance Method Summary collapse

Constructor Details

#initialize(organization, filter = "active", user = nil) ⇒ OrganizationPrioritizedParticipatoryProcesses

Returns a new instance of OrganizationPrioritizedParticipatoryProcesses.


8
9
10
11
12
# File 'decidim-participatory_processes/app/queries/decidim/participatory_processes/organization_prioritized_participatory_processes.rb', line 8

def initialize(organization, filter = "active", user = nil)
  @organization = organization
  @filter = filter
  @user = user
end

Instance Method Details

#queryObject


14
15
16
17
18
19
20
# File 'decidim-participatory_processes/app/queries/decidim/participatory_processes/organization_prioritized_participatory_processes.rb', line 14

def query
  Rectify::Query.merge(
    OrganizationPublishedParticipatoryProcesses.new(@organization, @user),
    PrioritizedParticipatoryProcesses.new,
    FilteredParticipatoryProcesses.new(@filter)
  ).query
end