Class: Decidim::Proposals::ApplicationController
- Inherits:
-
Components::BaseController
- Object
- DecidimController
- ApplicationController
- Components::BaseController
- Decidim::Proposals::ApplicationController
- Defined in:
- decidim-proposals/app/controllers/decidim/proposals/application_controller.rb
Overview
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.
Direct Known Subclasses
CollaborativeDraftsController, ProposalVotesController, ProposalsController, VersionsController
Instance Method Summary collapse
Methods inherited from Components::BaseController
#current_component, #current_manifest, #current_participatory_space, #permission_class_chain, #permission_scope, #redirect_unless_feature_private, #set_component_breadcrumb_item, #share_token
Methods included from RegistersPermissions
Methods included from UserBlockedChecker
#check_user_block_status, #check_user_not_blocked
Methods included from NeedsSnippets
Methods included from Headers::HttpCachingDisabler
Methods included from HasStoredPath
#skip_store_location?, #store_current_location
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#proposal_limit ⇒ Object
14 15 16 17 18 |
# File 'decidim-proposals/app/controllers/decidim/proposals/application_controller.rb', line 14 def proposal_limit return nil if component_settings.proposal_limit.zero? component_settings.proposal_limit end |
#proposal_limit_reached? ⇒ Boolean
20 21 22 23 24 |
# File 'decidim-proposals/app/controllers/decidim/proposals/application_controller.rb', line 20 def proposal_limit_reached? return false unless proposal_limit proposals.where(author: current_user).count >= proposal_limit end |
#proposals ⇒ Object
26 27 28 |
# File 'decidim-proposals/app/controllers/decidim/proposals/application_controller.rb', line 26 def proposals Proposal.where(component: current_component) end |