Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Useless files will be never deleted when using preserve_files #1704

Closed
kidlab opened this issue Nov 21, 2014 · 1 comment
Closed

Useless files will be never deleted when using preserve_files #1704

kidlab opened this issue Nov 21, 2014 · 1 comment

Comments

@kidlab
Copy link

kidlab commented Nov 21, 2014

I am using Paranoia for soft-delete, and use preserve_files to make them work together.

However, there is a problem when I want to perform a real delete (e.g really_destroy!) the files are not deleted! It means that useless files will stay there forever.

Then I looked at the code of Attachment, I understood why it happened:

    def queue_all_for_delete #:nodoc:
      return if !file?
      unless @options[:preserve_files]
        @queued_for_delete += [:original, *styles.keys].uniq.map do |style|
          path(style) if exists?(style)
        end.compact
      end
      # ...
    end

It's because files are never queued to delete!

@tute
Copy link
Contributor

tute commented May 16, 2015

Thanks for your report. Closing in favor of duplicate #1326.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants