docbrown/app/workers/webhook/destroy_worker.rb
rhymes 71d53873d1
Use Rails 6 new features in the code (#8342)
* Use pick instead of pluck first

* Use touch_all instead of update_all

* Use destroy_by instead of where.destroy_all

* Use scopes

* Fix db:seed:replant

* Remove ActiveSupport::Cache::RedisCacheStore expires_in cache
2020-06-08 16:06:29 -04:00

11 lines
269 B
Ruby

module Webhook
class DestroyWorker
include Sidekiq::Worker
sidekiq_options queue: :low_priority, retry: 10
def perform(user_id, application_id)
Webhook::Endpoint.destroy_by(user_id: user_id, oauth_application_id: application_id)
end
end
end