From a1d10beebe73c96fb741cd9f728292ae32e80fc3 Mon Sep 17 00:00:00 2001 From: Pawel Chojnacki Date: Tue, 6 Feb 2018 17:37:11 +0100 Subject: use find_or_initialize to fetch prometheus_service instance --- app/models/clusters/applications/prometheus.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/clusters/applications/prometheus.rb b/app/models/clusters/applications/prometheus.rb index 630f92adfcc..aa22e9d5d58 100644 --- a/app/models/clusters/applications/prometheus.rb +++ b/app/models/clusters/applications/prometheus.rb @@ -13,7 +13,7 @@ module Clusters state_machine :status do after_transition any => [:installed] do |application| application.cluster.projects.each do |project| - project.prometheus_service&.update(active: true) + project.find_or_initialize_service('prometheus').update(active: true) end end end -- cgit v1.2.1