aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/app/jobs/active_storage/purge_job.rb
blob: b021b5f2d0b89d43aecea7f43bea206a88c20c49 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
# frozen_string_literal: true

# Provides asynchronous purging of ActiveStorage::Blob records via ActiveStorage::Blob#purge_later.
class ActiveStorage::PurgeJob < ActiveStorage::BaseJob
  discard_on ActiveRecord::RecordNotFound, ActiveRecord::InvalidForeignKey

  def perform(blob)
    blob.purge
  end
end