2016-08-18 10:31:44 -04:00
|
|
|
class LfsObjectUploader < GitlabUploader
|
2015-10-12 10:42:14 -04:00
|
|
|
storage :file
|
|
|
|
|
|
|
|
def store_dir
|
2016-06-29 09:23:44 -04:00
|
|
|
"#{Gitlab.config.lfs.storage_path}/#{model.oid[0, 2]}/#{model.oid[2, 2]}"
|
2015-10-12 10:42:14 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def cache_dir
|
|
|
|
"#{Gitlab.config.lfs.storage_path}/tmp/cache"
|
|
|
|
end
|
|
|
|
|
|
|
|
def exists?
|
|
|
|
file.try(:exists?)
|
|
|
|
end
|
|
|
|
|
|
|
|
def filename
|
|
|
|
model.oid[4..-1]
|
|
|
|
end
|
|
|
|
end
|