Module: Decidim::Assemblies::NeedsAssembly

Defined in:
decidim-assemblies/app/controllers/concerns/decidim/assemblies/needs_assembly.rb

Overview

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

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Class Method Details

.enhance_controller(instance_or_module) ⇒ Object



8
9
10
11
12
# File 'decidim-assemblies/app/controllers/concerns/decidim/assemblies/needs_assembly.rb', line 8

def self.enhance_controller(instance_or_module)
  instance_or_module.class_eval do
    helper_method :current_assembly
  end
end

.extended(base) ⇒ Object



14
15
16
17
18
# File 'decidim-assemblies/app/controllers/concerns/decidim/assemblies/needs_assembly.rb', line 14

def self.extended(base)
  base.extend Decidim::NeedsOrganization, InstanceMethods

  enhance_controller(base)
end

.included(base) ⇒ Object



20
21
22
23
24
# File 'decidim-assemblies/app/controllers/concerns/decidim/assemblies/needs_assembly.rb', line 20

def self.included(base)
  base.include Decidim::NeedsOrganization, InstanceMethods

  enhance_controller(base)
end