Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-05-05 00:02:51 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2017-06-01 15:39:48 +0300
commite61f38d79eb85a7c601bd146d5b8e48a8b4418e5 (patch)
tree08abc6cb3f4ef57de157167fca8189a162298ae1 /app/uploaders/gitlab_uploader.rb
parentc72abcefe79dd906cbbf0088b442a8979e9fc746 (diff)
Fix data inconsistency issue for old artifacts by moving them to a currently used path
Diffstat (limited to 'app/uploaders/gitlab_uploader.rb')
-rw-r--r--app/uploaders/gitlab_uploader.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/uploaders/gitlab_uploader.rb b/app/uploaders/gitlab_uploader.rb
index e0a6c9b4067..c1d9007dc71 100644
--- a/app/uploaders/gitlab_uploader.rb
+++ b/app/uploaders/gitlab_uploader.rb
@@ -9,8 +9,16 @@ class GitlabUploader < CarrierWave::Uploader::Base
delegate :base_dir, to: :class
- def file_storage?
- self.class.storage == CarrierWave::Storage::File
+ def local_file?
+ local_storage? && file&.is_a?(CarrierWave::SanitizedFile)
+ end
+
+ def local_storage?
+ storage.is_a?(CarrierWave::Storage::File)
+ end
+
+ def local_cache_storage?
+ cache_storage.is_a?(CarrierWave::Storage::File)
end
# Reduce disk IO