summaryrefslogtreecommitdiff
path: root/app/models/environment.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-17 09:08:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-17 09:08:52 +0000
commit53ae6b7e3f83591ad251a3f771f5bf3b8cf087ba (patch)
tree5180b96d6a84f36a515cedfa8e81d72de5ccf4fb /app/models/environment.rb
parentcfe63cce6a90a1c70397c1b9f6d90480f25cae0a (diff)
downloadgitlab-ce-53ae6b7e3f83591ad251a3f771f5bf3b8cf087ba.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r--app/models/environment.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index 4635b05fcc7..bb41c4a066e 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -12,6 +12,7 @@ class Environment < ApplicationRecord
has_many :deployments, -> { visible }, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
has_many :successful_deployments, -> { success }, class_name: 'Deployment'
+ has_many :active_deployments, -> { active }, class_name: 'Deployment'
has_many :prometheus_alerts, inverse_of: :environment
has_one :last_deployment, -> { success.order('deployments.id DESC') }, class_name: 'Deployment'