Merge pull request #3174 from urbanrotnik/ur-sci-5500

Add purge workflow images task and migration [SCI-5500]
This commit is contained in:
Miha Mencin 2021-02-19 10:57:00 +01:00 committed by GitHub
commit 51a5a835ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -151,4 +151,14 @@ namespace :data do
end
end
end
desc 'Purge all experiment workflow images'
task purge_experiment_workflow_images: :environment do
ActiveStorage::Attachment.where(name: 'workflowimg').delete_all
end
desc 'Purge all experiment workflow images'
task cleanup_blobs: :environment do
ActiveStorage::Blob.unattached.find_each(&:purge_later)
end
end