diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-30 10:56:25 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-30 10:56:25 +0200 |
commit | 99ee822857cf3fdf0a2ac91c0d13ea68c79e8ba8 (patch) | |
tree | 39308f87a7c81eac25fcc694bf36986f38ea98a9 /app/uploaders | |
parent | e64b1e52a23016e51d581b87c08beaa4b18da689 (diff) | |
download | gitlab-ce-99ee822857cf3fdf0a2ac91c0d13ea68c79e8ba8.tar.gz |
Add method that returns markdown in file uploader
Diffstat (limited to 'app/uploaders')
-rw-r--r-- | app/uploaders/file_uploader.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb index 25d879ff449..730153a4740 100644 --- a/app/uploaders/file_uploader.rb +++ b/app/uploaders/file_uploader.rb @@ -32,6 +32,10 @@ class FileUploader < CarrierWave::Uploader::Base File.join("/uploads", @secret, file.filename) end + def to_markdown + to_h[:markdown] + end + def to_h filename = image? ? self.file.basename : self.file.filename escaped_filename = filename.gsub("]", "\\]") |