2015-10-12 14:42:14 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
class LfsObjectUploader < CarrierWave::Uploader::Base
|
|
|
|
storage :file
|
|
|
|
|
|
|
|
def store_dir
|
2016-06-29 13:23:44 +00:00
|
|
|
"#{Gitlab.config.lfs.storage_path}/#{model.oid[0, 2]}/#{model.oid[2, 2]}"
|
2015-10-12 14:42:14 +00:00
|
|
|
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
|