debian-mirror-gitlab/app/uploaders/packages/package_file_uploader.rb

26 lines
525 B
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
class Packages::PackageFileUploader < GitlabUploader
extend Workhorse::UploadPath
include ObjectStorage::Concern
2023-05-27 22:25:52 +05:30
storage_location :packages
2020-07-28 23:09:34 +05:30
alias_method :upload, :model
def filename
model.file_name
end
def store_dir
dynamic_segment
end
private
def dynamic_segment
2020-11-05 12:06:23 +05:30
raise ObjectNotReadyError, "Package model not ready" unless model.id
2022-10-11 01:57:18 +05:30
Gitlab::HashedPath.new('packages', model.package_id, 'files', model.id, root_hash: model.package.project_id)
2020-07-28 23:09:34 +05:30
end
end