Class: Decidim::ParticipatoryProcesses::OrganizationPrioritizedParticipatoryProcessGroups

Inherits:
Query
  • Object
show all
Defined in:
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.

[View source]

7
8
9
10
11
# File '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

[View source]

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

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