Sha256: 6afe78a000dff7b13c73766698c33d8587604ae294914349ee47a416fbee39bc
Contents?: true
Size: 892 Bytes
Versions: 64
Compression:
Stored size: 892 Bytes
Contents
# frozen_string_literal: true module Decidim module Proposals # This controller is the abstract class from which all other controllers of # this engine inherit. # # Note that it inherits from `Decidim::Components::BaseController`, which # override its layout and provide all kinds of useful methods. class ApplicationController < Decidim::Components::BaseController helper Decidim::Messaging::ConversationHelper helper_method :proposal_limit_reached? def proposal_limit return nil if component_settings.proposal_limit.zero? component_settings.proposal_limit end def proposal_limit_reached? return false unless proposal_limit proposals.where(author: current_user).count >= proposal_limit end def proposals Proposal.where(component: current_component) end end end end
Version data entries
64 entries across 64 versions & 1 rubygems