diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-14 15:08:59 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-14 15:08:59 +0000 |
commit | 9b762f50fee09b50b97b5ab208a9a62522447c8c (patch) | |
tree | 4dbd16c66f6aeacc1b88c1e3350df09ce4f91183 /app/uploaders | |
parent | 9769ccf613ec45634ee32efaf1c39763a759a917 (diff) | |
download | gitlab-ce-9b762f50fee09b50b97b5ab208a9a62522447c8c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/uploaders')
-rw-r--r-- | app/uploaders/metric_image_uploader.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/uploaders/metric_image_uploader.rb b/app/uploaders/metric_image_uploader.rb new file mode 100644 index 00000000000..0826bb251e4 --- /dev/null +++ b/app/uploaders/metric_image_uploader.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class MetricImageUploader < GitlabUploader # rubocop:disable Gitlab/NamespacedClass + include RecordsUploads::Concern + include ObjectStorage::Concern + prepend ObjectStorage::Extension::RecordsUploads + include UploaderHelper + + private + + def dynamic_segment + File.join(model.class.underscore, mounted_as.to_s, model.id.to_s) + end + + class << self + def default_store + object_store_enabled? ? ObjectStorage::Store::REMOTE : ObjectStorage::Store::LOCAL + end + end +end |