diff options
author | Jarka Kadlecová <jarka@gitlab.com> | 2018-08-20 15:46:22 +0300 |
---|---|---|
committer | Jarka Kadlecová <jarka@gitlab.com> | 2018-08-21 14:59:41 +0300 |
commit | 0a1c805d851c8945baf540736024ebc5d385ce58 (patch) | |
tree | 889a6ec2b4eabce50ec23452b99370f25f954e0a /app | |
parent | 3c80adf5c8486315fa84ac237177c38b9ae625c9 (diff) |
Fix NamespaceUploader.base_dir for remote uploads
Diffstat (limited to 'app')
-rw-r--r-- | app/uploaders/namespace_file_uploader.rb | 18 |
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 |