gitlab-org--gitlab-foss/app/uploaders/lfs_object_uploader.rb

25 lines
420 B
Ruby
Raw Normal View History

2016-08-18 10:31:44 -04:00
class LfsObjectUploader < GitlabUploader
2018-01-29 12:57:34 -05:00
extend Workhorse::UploadPath
2015-10-12 10:42:14 -04:00
2018-01-29 12:57:34 -05:00
# LfsObject are in `tmp/upload` instead of `tmp/uploads`
def self.workhorse_upload_path
File.join(root, 'tmp/upload')
2015-10-12 10:42:14 -04:00
end
2018-01-29 12:57:34 -05:00
storage_options Gitlab.config.lfs
2015-10-12 10:42:14 -04:00
def filename
model.oid[4..-1]
end
2018-01-29 12:57:34 -05:00
def store_dir
dynamic_segment
end
private
def dynamic_segment
File.join(model.oid[0, 2], model.oid[2, 2])
end
2015-10-12 10:42:14 -04:00
end