Attachment URL with non-/ relative root

The attachment URL was not working with relative_url_root not equal to '/'. I suggest this fix.
This commit is contained in:
Tomas Srna 2014-07-22 13:29:41 +02:00
parent 68a9203bce
commit 1072c95180

View file

@ -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}" Gitlab.config.gitlab.relative_url_root + "/files/#{model.class.to_s.underscore}/#{model.id}/#{file.filename}"
end end
def url
Gitlab.config.gitlab.relative_url_root + '' + super unless super.nil?
end
def file_storage? def file_storage?
self.class.storage == CarrierWave::Storage::File self.class.storage == CarrierWave::Storage::File
end end