Class: Gitlab::BackgroundMigration::FixProjectsWithoutPrometheusService::Migratable::Cluster

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/gitlab/background_migration/fix_projects_without_prometheus_service.rb

Overview

Migration model namespace isolated from application code.

Class Method Summary collapse

Class Method Details

.has_prometheus_application?Boolean

Returns:

  • (Boolean)


55
56
57
58
# File 'lib/gitlab/background_migration/fix_projects_without_prometheus_service.rb', line 55

def self.has_prometheus_application?
  joins("INNER JOIN clusters_applications_prometheus ON clusters_applications_prometheus.cluster_id = clusters.id
         AND clusters_applications_prometheus.status IN (#{Applications::Prometheus.statuses[:installed]}, #{Applications::Prometheus.statuses[:updated]})").exists?
end