Class: Decidim::ParticipatoryProcesses::OrganizationPrioritizedParticipatoryProcessGroups

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

Overview

This query class filters participatory process groups given an organization and a filter.

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of OrganizationPrioritizedParticipatoryProcessGroups.


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

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

Instance Method Details

#queryObject


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

def query
  Rectify::Query.merge(
    OrganizationParticipatoryProcessGroups.new(@organization),
    FilteredParticipatoryProcessGroups.new(@filter),
    VisibleParticipatoryProcessGroups.new(@user)
  ).query
end