1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-03 12:35:21 +02:00
Maybe/app/jobs/destroy_job.rb
2025-05-25 11:52:29 -04:00

9 lines
222 B
Ruby

class DestroyJob < ApplicationJob
queue_as :low_priority
def perform(model)
model.destroy
rescue => e
model.update!(scheduled_for_deletion: false) # Let's the user try again by resetting the state
end
end