Class: Decidim::Elections::Admin::ActionForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Elections::Admin::ActionForm
show all
- Defined in:
- 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_board ⇒ Object
32
33
34
|
# File 'app/forms/decidim/elections/admin/action_form.rb', line 32
def bulletin_board
@bulletin_board ||= context[:bulletin_board] || Decidim::Elections.bulletin_board
end
|
#current_step ⇒ Object
18
19
20
|
# File 'app/forms/decidim/elections/admin/action_form.rb', line 18
def current_step
@current_step ||= election.bb_status
end
|
#election ⇒ Object
22
23
24
|
# File 'app/forms/decidim/elections/admin/action_form.rb', line 22
def election
@election ||= context[:election]
end
|
#main_button? ⇒ Boolean
10
11
12
|
# File 'app/forms/decidim/elections/admin/action_form.rb', line 10
def main_button?
true
end
|
#messages ⇒ Object
14
15
16
|
# File 'app/forms/decidim/elections/admin/action_form.rb', line 14
def messages
@messages ||= {}
end
|
#pending_action ⇒ Object
26
27
28
29
30
|
# File 'app/forms/decidim/elections/admin/action_form.rb', line 26
def pending_action
return @pending_action if defined?(@pending_action)
@pending_action = election.actions.pending.first
end
|
#refresh ⇒ Object
36
37
38
39
|
# File 'app/forms/decidim/elections/admin/action_form.rb', line 36
def refresh
remove_instance_variable(:@pending_action)
remove_instance_variable(:@current_step)
end
|