summaryrefslogtreecommitdiff
path: root/app/uploaders/external_diff_uploader.rb
blob: d2707cd07774c84aca9eba8f769e57a8e206684c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

class ExternalDiffUploader < GitlabUploader
  include ObjectStorage::Concern

  storage_options Gitlab.config.external_diffs

  alias_method :upload, :model

  def filename
    "diff-#{model.id}"
  end

  def store_dir
    dynamic_segment
  end

  private

  def dynamic_segment
    File.join(model.model_name.plural, "mr-#{model.merge_request_id}")
  end
end