diff options
author | Tomas Srna <tomas@srna.sk> | 2014-07-22 13:29:41 +0200 |
---|---|---|
committer | Tomas Srna <tomas@srna.sk> | 2014-07-22 13:29:41 +0200 |
commit | 1072c95180aa31b999088fec4d14ce6765041a15 (patch) | |
tree | 02ebbbd531ea41e46b8e3e7eb6e6abdc67fb75ee /app/uploaders | |
parent | 68a9203bcef1e44bdf72acf4cc8d4977eec79b7a (diff) | |
download | gitlab-ce-1072c95180aa31b999088fec4d14ce6765041a15.tar.gz |
Attachment URL with non-/ relative root
The attachment URL was not working with relative_url_root not equal to '/'. I suggest this fix.
Diffstat (limited to 'app/uploaders')
-rw-r--r-- | app/uploaders/attachment_uploader.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/uploaders/attachment_uploader.rb b/app/uploaders/attachment_uploader.rb index b122b6c8658..24fc294909e 100644 --- a/app/uploaders/attachment_uploader.rb +++ b/app/uploaders/attachment_uploader.rb @@ -26,6 +26,10 @@ class AttachmentUploader < CarrierWave::Uploader::Base Gitlab.config.gitlab.relative_url_root + "/files/#{model.class.to_s.underscore}/#{model.id}/#{file.filename}" end + def url + Gitlab.config.gitlab.relative_url_root + '' + super unless super.nil? + end + def file_storage? self.class.storage == CarrierWave::Storage::File end |