Sha256: e0b6cad6bf4face8ab6d055d08b3b2db312430d0f685ef15c6908c138e3447c8
Contents?: true
Size: 842 Bytes
Versions: 5
Compression:
Stored size: 842 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_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
5 entries across 5 versions & 1 rubygems