Sha256: f0a9bd7e7506a2b5f97747f26be5544d63743b50ace781b3b482a20beed5e5be
Contents?: true
Size: 1.21 KB
Versions: 5
Compression:
Stored size: 1.21 KB
Contents
# frozen_string_literal: true module Decidim module Assemblies # A controller that holds the logic to show Assemblies in a # public layout. class AssembliesController < Decidim::ApplicationController layout "layouts/decidim/assembly", only: [:show] before_action -> { extend NeedsAssembly }, only: [:show] helper Decidim::AttachmentsHelper helper Decidim::IconHelper helper Decidim::WidgetUrlsHelper helper_method :collection, :promoted_assemblies, :assemblies, :stats def index redirect_to "/404" if published_assemblies.none? authorize! :read, Assembly end def show authorize! :read, current_assembly end private def published_assemblies @published_assemblies ||= OrganizationPublishedAssemblies.new(current_organization) end def assemblies @assemblies ||= OrganizationPrioritizedAssemblies.new(current_organization) end alias collection assemblies def promoted_assemblies @promoted_assemblies ||= assemblies | PromotedAssemblies.new end def stats @stats ||= AssemblyStatsPresenter.new(assembly: current_assembly) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems