Class: Decidim::ParticipatoryProcesses::VisibleParticipatoryProcesses

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

Overview

This query class filters participatory processes given a current_user.

Instance Method Summary collapse

Methods inherited from Query

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

Constructor Details

#initialize(current_user) ⇒ VisibleParticipatoryProcesses

Returns a new instance of VisibleParticipatoryProcesses.


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

def initialize(current_user)
  @current_user = current_user
end

Instance Method Details

#queryObject


11
12
13
# File 'decidim-participatory_processes/app/queries/decidim/participatory_processes/visible_participatory_processes.rb', line 11

def query
  Decidim::ParticipatoryProcess.visible_for(@current_user)
end