summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
authorMicaƫl Bergeron <mbergeron@gitlab.com>2018-06-28 11:25:40 -0400
committerStan Hu <stanhu@gmail.com>2018-07-03 09:57:15 -0700
commit91c9c4b72888f95fc07d14a008ec48c8114b4e41 (patch)
treea0cf98e670ee9b768ec55ba6cdf09ee7e6a531c8 /app/uploaders
parentcebdd267e672c75696cd534bb89d10fda8de129f (diff)
downloadgitlab-ce-91c9c4b72888f95fc07d14a008ec48c8114b4e41.tar.gz
fix an issue with local files
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