summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
authorJarka Kadlecová <jarka@gitlab.com>2018-08-20 14:46:22 +0200
committerJarka Kadlecová <jarka@gitlab.com>2018-08-21 13:59:41 +0200
commit0a1c805d851c8945baf540736024ebc5d385ce58 (patch)
tree889a6ec2b4eabce50ec23452b99370f25f954e0a /app/uploaders
parent3c80adf5c8486315fa84ac237177c38b9ae625c9 (diff)
downloadgitlab-ce-0a1c805d851c8945baf540736024ebc5d385ce58.tar.gz
Fix NamespaceUploader.base_dir for remote uploadsfix-namespace-uploader
Diffstat (limited to 'app/uploaders')
-rw-r--r--app/uploaders/namespace_file_uploader.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/uploaders/namespace_file_uploader.rb b/app/uploaders/namespace_file_uploader.rb
index 52969762b7d..b0154f85a5c 100644
--- a/app/uploaders/namespace_file_uploader.rb
+++ b/app/uploaders/namespace_file_uploader.rb
@@ -6,8 +6,15 @@ class NamespaceFileUploader < FileUploader
options.storage_path
end
- def self.base_dir(model, _store = nil)
- File.join(options.base_dir, 'namespace', model_path_segment(model))
+ def self.base_dir(model, store = nil)
+ base_dirs(model)[store || Store::LOCAL]
+ end
+
+ def self.base_dirs(model)
+ {
+ Store::LOCAL => File.join(options.base_dir, 'namespace', model_path_segment(model)),
+ Store::REMOTE => File.join('namespace', model_path_segment(model))
+ }
end
def self.model_path_segment(model)
@@ -18,11 +25,4 @@ class NamespaceFileUploader < FileUploader
def store_dir
store_dirs[object_store]
end
-
- def store_dirs
- {
- Store::LOCAL => File.join(base_dir, dynamic_segment),
- Store::REMOTE => File.join('namespace', self.class.model_path_segment(model), dynamic_segment)
- }
- end
end