trigger_webhook_worker.rb 267 B

123456789101112
  1. # frozen_string_literal: true
  2. class TriggerWebhookWorker
  3. include Sidekiq::Worker
  4. def perform(event, class_name, id)
  5. object = class_name.constantize.find(id)
  6. WebhookService.new.call(event, object)
  7. rescue ActiveRecord::RecordNotFound
  8. true
  9. end
  10. end