Class: Webhooks::AttemptsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/webhooks/attempts_controller.rb

Instance Method Summary collapse

Instance Method Details

#reattemptObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/webhooks/attempts_controller.rb', line 11

def reattempt
  @attempt = Webhooks::Attempt.find(params[:id])

  if @attempt.reattempt(manual_reattempt: true)
    redirect_back fallback_location: attempt_path(@attempt), flash: {
      success: 'Will attempt to deliver event again',
    }
  else
    redirect_back fallback_location: attempt_path(@attempt), flash: {
      error: 'Could not attempt delivering event again',
    }
  end
end

#showObject



7
8
9
# File 'app/controllers/webhooks/attempts_controller.rb', line 7

def show
  @attempt = Webhooks::Attempt.find(params[:id])
end