summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
Diffstat (limited to 'app/uploaders')
-rw-r--r--app/uploaders/file_uploader.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb
index 28399f1e051..73606eb9f83 100644
--- a/app/uploaders/file_uploader.rb
+++ b/app/uploaders/file_uploader.rb
@@ -162,12 +162,14 @@ class FileUploader < GitlabUploader
end
def copy_file(file)
- if file_storage?
- store!(file)
- else
- self.file = file.copy_to(store_path)
- record_upload # after_store is not triggered
- end
+ to_path = if file_storage?
+ File.join(self.class.root, store_path)
+ else
+ store_path
+ end
+
+ self.file = file.copy_to(to_path)
+ record_upload # after_store is not triggered
end
private