debian-mirror-gitlab/app/uploaders/lfs_object_uploader.rb

28 lines
407 B
Ruby
Raw Normal View History

2015-11-26 14:37:03 +05:30
class LfsObjectUploader < CarrierWave::Uploader::Base
storage :file
def store_dir
2016-08-24 12:49:21 +05:30
"#{Gitlab.config.lfs.storage_path}/#{model.oid[0, 2]}/#{model.oid[2, 2]}"
2015-11-26 14:37:03 +05:30
end
def cache_dir
"#{Gitlab.config.lfs.storage_path}/tmp/cache"
end
def move_to_cache
true
end
def move_to_store
true
end
def exists?
file.try(:exists?)
end
def filename
model.oid[4..-1]
end
end