From 637c9558627655aaf08066371f0a5d50461578be Mon Sep 17 00:00:00 2001 From: Pawel Chojnacki Date: Mon, 26 Feb 2018 12:40:40 +0100 Subject: Fix failing test, when deployment platform is not bound to a cluster. --- app/models/environment.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/models/environment.rb') diff --git a/app/models/environment.rb b/app/models/environment.rb index 966ce17a48a..0c408257499 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -233,8 +233,10 @@ class Environment < ActiveRecord::Base end def cluster_prometheus_adapter - cluster = project.deployment_platform&.cluster - return unless cluster&.application_prometheus&.installed? + return unless project.deployment_platform.respond_to?(:cluster) + + cluster = project.deployment_platform.cluster + return unless cluster.application_prometheus&.installed? cluster.application_prometheus end -- cgit v1.2.1