summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-02-20 15:56:12 +0100
committerDouwe Maan <douwe@gitlab.com>2015-02-20 16:01:37 +0100
commit7f1adc3d9cdc5c3f1c0fcbf6c72d89b8ee062af5 (patch)
tree4c4e79d21dc6d2ec0d280debfc0b469d92f27725 /app/uploaders
parent218283b368161130f43333e75629870c9649b319 (diff)
downloadgitlab-ce-7f1adc3d9cdc5c3f1c0fcbf6c72d89b8ee062af5.tar.gz
Fix URL to uploaded file.
Diffstat (limited to 'app/uploaders')
-rw-r--r--app/uploaders/file_uploader.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb
index 36a28f93c49..f9673abbfe8 100644
--- a/app/uploaders/file_uploader.rb
+++ b/app/uploaders/file_uploader.rb
@@ -25,6 +25,10 @@ class FileUploader < CarrierWave::Uploader::Base
SecureRandom.hex
end
+ def secure_url
+ File.join(Gitlab.config.gitlab.url, @project.path_with_namespace, "uploads", @secret, file.filename)
+ end
+
def file_storage?
self.class.storage == CarrierWave::Storage::File
end