Class: Decidim::ParticipatoryProcessGroups::ContentBlocks::RelatedProcessesCell

Inherits:
Decidim::ParticipatoryProcesses::ContentBlocks::RelatedProcessesCell show all
Defined in:
app/cells/decidim/participatory_process_groups/content_blocks/related_processes_cell.rb

Instance Method Summary collapse

Methods inherited from Decidim::ParticipatoryProcesses::ContentBlocks::RelatedProcessesCell

#show

Instance Method Details

#filtered_processesObject



15
16
17
18
19
# File 'app/cells/decidim/participatory_process_groups/content_blocks/related_processes_cell.rb', line 15

def filtered_processes
  return related_processes unless filter_active?

  related_processes.active
end


7
8
9
10
11
12
13
# File 'app/cells/decidim/participatory_process_groups/content_blocks/related_processes_cell.rb', line 7

def related_processes
  @related_processes ||=
    Decidim::ParticipatoryProcesses::GroupPublishedParticipatoryProcesses.new(
      resource,
      current_user
    ).query
end

#total_countObject



21
22
23
# File 'app/cells/decidim/participatory_process_groups/content_blocks/related_processes_cell.rb', line 21

def total_count
  filtered_processes.size
end