Class: Decidim::Elections::Admin::ActionForm

Inherits:
Form
  • Object
show all
Defined in:
decidim-elections/app/forms/decidim/elections/admin/action_form.rb

Overview

This class holds a form to perform an action on the BB.

Instance Method Summary collapse

Instance Method Details

#bulletin_boardObject


28
29
30
# File 'decidim-elections/app/forms/decidim/elections/admin/action_form.rb', line 28

def bulletin_board
  @bulletin_board ||= context[:bulletin_board] || Decidim::Elections.bulletin_board
end

#current_stepObject


14
15
16
# File 'decidim-elections/app/forms/decidim/elections/admin/action_form.rb', line 14

def current_step
  @current_step ||= election.bb_status
end

#electionObject


18
19
20
# File 'decidim-elections/app/forms/decidim/elections/admin/action_form.rb', line 18

def election
  @election ||= context[:election]
end

#messagesObject


10
11
12
# File 'decidim-elections/app/forms/decidim/elections/admin/action_form.rb', line 10

def messages
  @messages ||= {}
end

#pending_actionObject


22
23
24
25
26
# File 'decidim-elections/app/forms/decidim/elections/admin/action_form.rb', line 22

def pending_action
  return @pending_action if defined?(@pending_action)

  @pending_action = election.actions.pending.first
end

#refreshObject


32
33
34
35
# File 'decidim-elections/app/forms/decidim/elections/admin/action_form.rb', line 32

def refresh
  remove_instance_variable(:@pending_action)
  remove_instance_variable(:@current_step)
end