uploads.rb 577 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
module Gitlab
  module Verify
    class Uploads < BatchVerifier
      def name
        'Uploads'
      end

      def describe(object)
        "Upload: #{object.id}"
      end

      private

14 15 16 17 18 19
      def all_relation
        Upload.all
      end

      def local?(upload)
        upload.local?
20 21 22 23 24 25 26 27 28
      end

      def expected_checksum(upload)
        upload.checksum
      end

      def actual_checksum(upload)
        Upload.hexdigest(upload.absolute_path)
      end
29 30 31 32

      def remote_object_exists?(upload)
        upload.build_uploader.file.exists?
      end
33 34 35
    end
  end
end