diff options
author | Jasper Martin <jaspervanbrianmartin@gmail.com> | 2018-07-26 21:24:31 +0800 |
---|---|---|
committer | George Claghorn <george.claghorn@gmail.com> | 2018-07-26 09:24:31 -0400 |
commit | 934fccd5223ae41f3f1cc7d548af509302f64828 (patch) | |
tree | b4ed89df2087796fa7cbeb139803efda693ae154 /activestorage/app/jobs | |
parent | 8a5fe2bcded1468934f060666a69dcd7d1fac9ae (diff) | |
download | rails-934fccd5223ae41f3f1cc7d548af509302f64828.tar.gz rails-934fccd5223ae41f3f1cc7d548af509302f64828.tar.bz2 rails-934fccd5223ae41f3f1cc7d548af509302f64828.zip |
Ignore ActiveRecord::InvalidForeignKey in ActiveStorage::Blob#purge
Do nothing instead of raising an error when it’s called on an attached blob.
Diffstat (limited to 'activestorage/app/jobs')
-rw-r--r-- | activestorage/app/jobs/active_storage/purge_job.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activestorage/app/jobs/active_storage/purge_job.rb b/activestorage/app/jobs/active_storage/purge_job.rb index b021b5f2d0..fa15e0451d 100644 --- a/activestorage/app/jobs/active_storage/purge_job.rb +++ b/activestorage/app/jobs/active_storage/purge_job.rb @@ -2,7 +2,7 @@ # Provides asynchronous purging of ActiveStorage::Blob records via ActiveStorage::Blob#purge_later. class ActiveStorage::PurgeJob < ActiveStorage::BaseJob - discard_on ActiveRecord::RecordNotFound, ActiveRecord::InvalidForeignKey + discard_on ActiveRecord::RecordNotFound def perform(blob) blob.purge |