Sha256: 20a9e9fcaf05e4ee17e93e64446191495b2b711ee34a2c9069976673a0a49074
Contents?: true
Size: 895 Bytes
Versions: 11
Compression:
Stored size: 895 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::Features::BaseController`, which # override its layout and provide all kinds of useful methods. class ApplicationController < Decidim::Features::BaseController helper Decidim::Messaging::ConversationHelper helper_method :proposal_limit_reached? private def proposal_limit return nil if feature_settings.proposal_limit.zero? feature_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(feature: current_feature) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems