2018-03-05 06:16:17 -05:00
|
|
|
module Gitlab
|
|
|
|
module Verify
|
|
|
|
class Uploads < BatchVerifier
|
|
|
|
def name
|
|
|
|
'Uploads'
|
|
|
|
end
|
|
|
|
|
|
|
|
def describe(object)
|
|
|
|
"Upload: #{object.id}"
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2018-06-13 13:11:43 -04:00
|
|
|
def all_relation
|
|
|
|
Upload.all
|
|
|
|
end
|
|
|
|
|
|
|
|
def local?(upload)
|
|
|
|
upload.local?
|
2018-03-05 06:16:17 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def expected_checksum(upload)
|
|
|
|
upload.checksum
|
|
|
|
end
|
|
|
|
|
|
|
|
def actual_checksum(upload)
|
|
|
|
Upload.hexdigest(upload.absolute_path)
|
|
|
|
end
|
2018-06-13 13:11:43 -04:00
|
|
|
|
|
|
|
def remote_object_exists?(upload)
|
|
|
|
upload.build_uploader.file.exists?
|
|
|
|
end
|
2018-03-05 06:16:17 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|