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

populate_dismissed_state_for_vulnerabilities.rb « background_migration « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 68c91650d93baf4641c8da2bfba5c1760c093294 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

module Gitlab
  module BackgroundMigration
    # This class updates vulnerabilities entities with state dismissed
    class PopulateDismissedStateForVulnerabilities
      class Vulnerability < ActiveRecord::Base # rubocop:disable Style/Documentation
        self.table_name = 'vulnerabilities'
      end

      def perform(*vulnerability_ids)
        Vulnerability.where(id: vulnerability_ids).update_all(state: 2)
        PopulateMissingVulnerabilityDismissalInformation.new.perform(*vulnerability_ids)
      end
    end
  end
end