aboutsummaryrefslogtreecommitdiffstats
path: root/app/jobs
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2017-07-22 09:47:24 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2017-07-22 09:47:24 -0500
commitd50679f4eefde1aca1ab71ba3c0109739cfdff3f (patch)
treeac9034fe7c4aa64cd5e90ecebc346d478917387c /app/jobs
parent5b7c31c23a708de77b3d73b68aec0ba99c8be861 (diff)
downloadrails-d50679f4eefde1aca1ab71ba3c0109739cfdff3f.tar.gz
rails-d50679f4eefde1aca1ab71ba3c0109739cfdff3f.tar.bz2
rails-d50679f4eefde1aca1ab71ba3c0109739cfdff3f.zip
Move models and jobs to the app setup
Follow engine conventions more closely
Diffstat (limited to 'app/jobs')
-rw-r--r--app/jobs/active_storage/purge_job.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/jobs/active_storage/purge_job.rb b/app/jobs/active_storage/purge_job.rb
new file mode 100644
index 0000000000..b59d3687f8
--- /dev/null
+++ b/app/jobs/active_storage/purge_job.rb
@@ -0,0 +1,10 @@
+require "active_job"
+
+class ActiveStorage::PurgeJob < ActiveJob::Base
+ # FIXME: Limit this to a custom ActiveStorage error
+ retry_on StandardError
+
+ def perform(attachment_or_blob)
+ attachment_or_blob.purge
+ end
+end