Skip to content

Commit

Permalink
Merge branch 'patch-activestorage-delete'
Browse files Browse the repository at this point in the history
  • Loading branch information
gbp committed Mar 24, 2022
2 parents 0b73b61 + 57608d9 commit a7df743
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/model_patches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,14 @@ def disable

prepend DisableWithProtection
end

ActiveStorage::Blob.class_eval do
def delete
service.delete(key)
# Prevent deletion of variants. We don't currently use variants and this
# causes timeouts (when doing a remote globs to find variant files to be
# deleted) when using a ActiveStorage SFTP service
# service.delete_prefixed("variants/#{key}/") if image?
end
end
end

0 comments on commit a7df743

Please sign in to comment.