openaustralia/morph

View on GitHub
app/models/webhook_delivery.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# typed: strict
# frozen_string_literal: true

class WebhookDelivery < ApplicationRecord
  extend T::Sig
  SUCCESSFUL_STATUSES = T.let((200..299).freeze, T::Range[Integer])

  belongs_to :webhook
  belongs_to :run

  sig { returns(T::Boolean) }
  def success?
    SUCCESSFUL_STATUSES.include?(response_code)
  end
end