From 1caaf5208f95d41a5bd30f589b7bdeec9707c8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 30 May 2016 09:46:27 +0200 Subject: [PATCH] move tombstone under 'uploads/' for easier deployment --- lib/file_store/local_store.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/file_store/local_store.rb b/lib/file_store/local_store.rb index e9bbdab6a..5054c7cc8 100644 --- a/lib/file_store/local_store.rb +++ b/lib/file_store/local_store.rb @@ -13,9 +13,9 @@ module FileStore return unless is_relative?(url) path = public_dir + url return if !File.exists?(path) - tombstone = public_dir + url.sub("/uploads/", "/tombstone/") - FileUtils.mkdir_p(Pathname.new(tombstone).dirname) - FileUtils.move(path, tombstone, :force => true) + tombstone = public_dir + url.sub("/uploads/", "/uploads/tombstone/") + FileUtils.mkdir_p(tombstone_dir) + FileUtils.move(path, tombstone, force: true) end def has_been_uploaded?(url) @@ -85,7 +85,7 @@ module FileStore end def tombstone_dir - public_dir + relative_base_url.sub("/uploads/", "/tombstone/") + public_dir + relative_base_url.sub("/uploads/", "/uploads/tombstone/") end end