Class: Decidim::Budgets::ApplicationController

Inherits:
Components::BaseController
  • Object
show all
Defined in:
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

Instance Method Details

#current_workflowObject



13
14
15
# File '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 '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 'app/controllers/decidim/budgets/application_controller.rb', line 17

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