Class: Decidim::ParticipatoryProcesses::ContentBlocks::RelatedProcessesCell

Inherits:
ContentBlocks::BaseCell
  • Object
show all
Defined in:
app/cells/decidim/participatory_processes/content_blocks/related_processes_cell.rb

Instance Method Summary collapse

Instance Method Details

#filtered_processesObject



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

def filtered_processes
  return related_processes unless limit?

  related_processes.limit(limit)
end


11
12
13
14
15
16
17
# File 'app/cells/decidim/participatory_processes/content_blocks/related_processes_cell.rb', line 11

def related_processes
  @related_processes ||=
    resource
    .linked_participatory_space_resources(:participatory_processes, link_name)
    .published
    .all
end

#showObject



7
8
9
# File 'app/cells/decidim/participatory_processes/content_blocks/related_processes_cell.rb', line 7

def show
  render if total_count.positive?
end

#total_countObject



25
26
27
# File 'app/cells/decidim/participatory_processes/content_blocks/related_processes_cell.rb', line 25

def total_count
  related_processes.size
end