diff options
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r-- | app/models/environment.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb index 62db7e958ab..b391a487b30 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -158,19 +158,15 @@ class Environment < ActiveRecord::Base end def has_additional_metrics? - prometheus_service.present? && available? && last_deployment.present? + project.prometheus_service.present? && available? && last_deployment.present? end def additional_metrics if has_additional_metrics? - prometheus_service.additional_environment_metrics(self) + project.prometheus_service.additional_environment_metrics(self) end end - def prometheus_service - @prometheus_service ||= project.monitoring_services.reorder(nil).find_by(active: true, type: PrometheusService.name) - end - # An environment name is not necessarily suitable for use in URLs, DNS # or other third-party contexts, so provide a slugified version. A slug has # the following properties: |