A platform for community discussion. Free, open, simple.
FIX: Error when trying to move the same file to tombstone.
Guo Xiang Tan5b934cb33ddf
diff --git a/lib/file_store/local_store.rb b/lib/file_store/local_store.rbindex 988497c0b20..09af9701f3a 100644--- a/lib/file_store/local_store.rb+++ b/lib/file_store/local_store.rb@@ -16,6 +16,7 @@ module FileStoredestination = "#{public_dir}#{url.sub("/uploads/", "/uploads/tombstone/")}"dir = Pathname.new(destination).dirnameFileUtils.mkdir_p(dir) unless Dir.exists?(dir)+ FileUtils.remove(destination) if File.exists?(destination)FileUtils.move(source, destination, force: true)FileUtils.touch(destination)end