Class: Actions::ForemanPatch::Invocation::Reschedule

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

Instance Method Summary collapse

Instance Method Details

#plan(invocation) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'app/lib/actions/foreman_patch/invocation/reschedule.rb', line 6

def plan(invocation)
  action_subject(invocation)
  
  round = invocation.cycle.rounds.find_by(group: invocation.host.group)

  if round.nil?
    invocation.destroy
  else
    invocation.update!(round: round)
  end
end