Sha256: 94b1c5b4401bb725a85f82cae85da5ce0530567099101d1693ef4e75df509be4
Contents?: true
Size: 847 Bytes
Versions: 16
Compression:
Stored size: 847 Bytes
Contents
# frozen_string_literal: true module Decidim module Plans # 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 :plan_limit_reached? def plan_limit return nil if component_settings.plan_limit.zero? component_settings.plan_limit end def plan_limit_reached? return false unless plan_limit plans.where(author: current_user).count >= plan_limit end def plans Plan.where(component: current_component) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems