Class: Actions::ForemanPatch::Cycle::Complete
- Inherits:
-
EntryAction
- Object
- EntryAction
- Actions::ForemanPatch::Cycle::Complete
- Defined in:
- app/lib/actions/foreman_patch/cycle/complete.rb
Instance Method Summary collapse
- #delay(delay_options, cycle) ⇒ Object
- #finalize ⇒ Object
- #humanized_name ⇒ Object
- #plan(cycle) ⇒ Object
Instance Method Details
#delay(delay_options, cycle) ⇒ Object
6 7 8 9 10 |
# File 'app/lib/actions/foreman_patch/cycle/complete.rb', line 6 def delay(, cycle) action_subject(cycle) super , cycle end |
#finalize ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/lib/actions/foreman_patch/cycle/complete.rb', line 18 def finalize users = ::User.select { |user| user.receives?(:patch_cycle_completed) }.compact begin MailNotification[:patch_cycle_completed].deliver(users: users, cycle: cycle) unless users.blank? rescue => error Rails.logger.error(error) end end |
#humanized_name ⇒ Object
28 29 30 |
# File 'app/lib/actions/foreman_patch/cycle/complete.rb', line 28 def humanized_name _('Complete Patch Cycle: %s') % input[:cycle][:name] end |
#plan(cycle) ⇒ Object
12 13 14 15 16 |
# File 'app/lib/actions/foreman_patch/cycle/complete.rb', line 12 def plan(cycle) action_subject(cycle) plan_self end |