diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-12-06 14:36:11 +0300 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-12-07 14:27:52 +0300 |
commit | f7c18ca31469b199c1a898cef583c9aae99f1375 (patch) | |
tree | 72182129a81d996a886ea765514d20bc7e2bcf8c /app/uploaders/namespace_file_uploader.rb | |
parent | fe62860e05ca6e3ef7125fe92fdf52cd6f7b63df (diff) |
Support uploads for groups
Diffstat (limited to 'app/uploaders/namespace_file_uploader.rb')
-rw-r--r-- | app/uploaders/namespace_file_uploader.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/uploaders/namespace_file_uploader.rb b/app/uploaders/namespace_file_uploader.rb new file mode 100644 index 00000000000..672126e9ec2 --- /dev/null +++ b/app/uploaders/namespace_file_uploader.rb @@ -0,0 +1,15 @@ +class NamespaceFileUploader < FileUploader + def self.base_dir + File.join(root_dir, '-', 'system', 'namespace') + end + + def self.dynamic_path_segment(model) + dynamic_path_builder(model.id.to_s) + end + + private + + def secure_url + File.join('/uploads', @secret, file.filename) + end +end |