Module: Decidim::ParticipatoryProcesses::ParticipatoryProcessContext

Defined in:
app/controllers/concerns/decidim/participatory_processes/participatory_process_context.rb

Overview

This module, when injected into a controller, ensures there’s a Participatory Process available and deducts it from the context.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/concerns/decidim/participatory_processes/participatory_process_context.rb', line 8

def self.extended(base)
  base.class_eval do
    include NeedsParticipatoryProcess

    layout "layouts/decidim/participatory_process"

    helper ParticipatoryProcessHelper

    before_action do
      authorize! :read, current_participatory_process
    end
  end
end

Instance Method Details

#ability_contextObject



22
23
24
# File 'app/controllers/concerns/decidim/participatory_processes/participatory_process_context.rb', line 22

def ability_context
  super.merge(current_participatory_process: current_participatory_process)
end