diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2018-02-07 01:53:18 +0100 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2018-02-07 01:54:09 +0100 |
commit | 8cb105cf5fe0418c34cf4448304062edffe309dc (patch) | |
tree | 10e88fd26f6738ae4b03dfc733893bb1f4f965f2 /app | |
parent | 277f7fef2c7369dc9fc8f54f9ad35a2d3086ee2b (diff) | |
download | gitlab-ce-8cb105cf5fe0418c34cf4448304062edffe309dc.tar.gz |
Fix order of checks in editable? method.
+ address small nitpicks
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project_services/prometheus_service.rb | 7 |
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 |