Class: Decidim::ParticipatoryProcesses::OrganizationPrioritizedParticipatoryProcessGroups

Inherits:
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

Methods inherited from Query

#cached_query, #each, #eager?, #exists?, merge, #none?, #relation?, #|

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
  Decidim::Query.merge(
    OrganizationParticipatoryProcessGroups.new(@organization),
    FilteredParticipatoryProcessGroups.new(@filter),
    VisibleParticipatoryProcessGroups.new(@user)
  ).query
end