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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2018-02-07 03:53:18 +0300
committerPawel Chojnacki <pawel@chojnacki.ws>2018-02-07 03:54:09 +0300
commit8cb105cf5fe0418c34cf4448304062edffe309dc (patch)
tree10e88fd26f6738ae4b03dfc733893bb1f4f965f2 /app/models/project_services
parent277f7fef2c7369dc9fc8f54f9ad35a2d3086ee2b (diff)
Fix order of checks in editable? method.
+ address small nitpicks
Diffstat (limited to 'app/models/project_services')
-rw-r--r--app/models/project_services/prometheus_service.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/project_services/prometheus_service.rb b/app/models/project_services/prometheus_service.rb
index e07340d572d..1bb576ff971 100644
--- a/app/models/project_services/prometheus_service.rb
+++ b/app/models/project_services/prometheus_service.rb
@@ -28,7 +28,7 @@ class PrometheusService < MonitoringService
end
def editable?
- !prometheus_installed? || manual_configuration?
+ manual_configuration? || !prometheus_installed?
end
def title
@@ -126,7 +126,8 @@ class PrometheusService < MonitoringService
end
def prometheus_installed?
- return false if template? || !project
+ return false if template?
+ return false unless project
project.clusters.enabled.any? { |cluster| cluster.application_prometheus&.installed? }
end
@@ -157,7 +158,7 @@ class PrometheusService < MonitoringService
end
def synchronize_service_state!
- self.active = prometheus_installed? || self.manual_configuration?
+ self.active = prometheus_installed? || manual_configuration?
true
end