Sha256: d0d5e7597a67a5940abebb823efa76060ad196c5a17655cf352c97c5214ea62c

Contents?: true

Size: 577 Bytes

Versions: 27

Compression:

Stored size: 577 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Assemblies
    # This module, when injected into a controller, ensures there's a
    # Assembly available and deducts it from the context.
    module AssemblyContext
      def self.extended(base)
        base.class_eval do
          include NeedsAssembly

          layout "layouts/decidim/assembly"

          before_action do
            authorize! :read, current_assembly
          end
        end
      end

      def ability_context
        super.merge(current_assembly: current_assembly)
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
decidim-assemblies-0.8.3 app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-assemblies-0.8.2 app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-assemblies-0.8.1 app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-assemblies-0.8.0 app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-assemblies-0.7.4 app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-assemblies-0.7.3 app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-assemblies-0.7.2 app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-assemblies-0.7.1 app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-assemblies-0.7.0 app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-assemblies-0.6.8 app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-0.6.8 decidim-assemblies/app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-assemblies-0.6.7 app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-0.6.7 decidim-assemblies/app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-assemblies-0.6.6 app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-0.6.6 decidim-assemblies/app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-assemblies-0.6.5 app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-0.6.5 decidim-assemblies/app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-assemblies-0.6.4 app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-0.6.4 decidim-assemblies/app/controllers/concerns/decidim/assemblies/assembly_context.rb
decidim-assemblies-0.6.3 app/controllers/concerns/decidim/assemblies/assembly_context.rb