Class: Decidim::Budgets::ApplicationController

Inherits:
Components::BaseController show all
Defined in:
decidim-budgets/app/controllers/decidim/budgets/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.

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

Methods included from RegistersPermissions

register_permissions

Methods inherited from ApplicationController

#store_share_token

Methods included from UserBlockedChecker

#check_user_block_status, #check_user_not_blocked

Methods included from NeedsSnippets

#snippets

Methods included from Headers::HttpCachingDisabler

#disable_http_caching

Methods included from HasStoredPath

#skip_store_location?, #store_current_location

Methods included from TranslatableAttributes

#default_locale?

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#current_workflowObject



13
14
15
# File 'decidim-budgets/app/controllers/decidim/budgets/application_controller.rb', line 13

def current_workflow
  @current_workflow ||= Decidim::Budgets.workflows[workflow_name].new(current_component, current_user)
end

#voting_finished?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'decidim-budgets/app/controllers/decidim/budgets/application_controller.rb', line 21

def voting_finished?
  current_settings.votes == "finished"
end

#voting_open?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'decidim-budgets/app/controllers/decidim/budgets/application_controller.rb', line 17

def voting_open?
  current_settings.votes == "enabled"
end