Class: Actions::ForemanPatch::Cycle::Complete

Inherits:
EntryAction
  • Object
show all
Defined in:
app/lib/actions/foreman_patch/cycle/complete.rb

Instance Method Summary collapse

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(delay_options, cycle)
  action_subject(cycle)

  super delay_options, cycle
end

#finalizeObject



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_nameObject



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