Welcome to mirror list, hosted at ThFree Co, Russian Federation.

uploads.rb « verify « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 73fc43cb5901d8f9b29650d4bf371b8d2d92735c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module Gitlab
  module Verify
    class Uploads < BatchVerifier
      def name
        'Uploads'
      end

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

      private

      def all_relation
        Upload.all.preload(:model)
      end

      def local?(upload)
        upload.local?
      end

      def expected_checksum(upload)
        upload.checksum
      end

      def actual_checksum(upload)
        Upload.hexdigest(upload.absolute_path)
      end

      def remote_object_exists?(upload)
        upload.build_uploader.file.exists?
      end
    end
  end
end