aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib/active_storage/service/mirror_service.rb
diff options
context:
space:
mode:
authorGeorge Claghorn <george.claghorn@gmail.com>2017-12-02 22:43:28 -0500
committerGitHub <noreply@github.com>2017-12-02 22:43:28 -0500
commit8c5a7fbefd3cad403e7594d0b6a5488d80d4c98e (patch)
tree837dc872b3769a9ec4e08096c0ef2847288f64ba /activestorage/lib/active_storage/service/mirror_service.rb
parentb23e381c89aa91451d73d3a1b1b6e4cbe7bc7780 (diff)
downloadrails-8c5a7fbefd3cad403e7594d0b6a5488d80d4c98e.tar.gz
rails-8c5a7fbefd3cad403e7594d0b6a5488d80d4c98e.tar.bz2
rails-8c5a7fbefd3cad403e7594d0b6a5488d80d4c98e.zip
Purge variants with their blobs
Diffstat (limited to 'activestorage/lib/active_storage/service/mirror_service.rb')
-rw-r--r--activestorage/lib/active_storage/service/mirror_service.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activestorage/lib/active_storage/service/mirror_service.rb b/activestorage/lib/active_storage/service/mirror_service.rb
index 39e922f7ab..7eca8ce7f4 100644
--- a/activestorage/lib/active_storage/service/mirror_service.rb
+++ b/activestorage/lib/active_storage/service/mirror_service.rb
@@ -35,6 +35,11 @@ module ActiveStorage
perform_across_services :delete, key
end
+ # Delete files at keys starting with the +prefix+ on all services.
+ def delete_prefixed(prefix)
+ perform_across_services :delete_prefixed, prefix
+ end
+
private
def each_service(&block)
[ primary, *mirrors ].each(&block)