summaryrefslogtreecommitdiff
path: root/app/models/environment.rb
diff options
context:
space:
mode:
authorPeter Leitzen <pleitzen@gitlab.com>2018-10-12 14:10:34 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-10-12 14:10:34 +0000
commit4d9ede0be7ea4dae92d224454616f9e65da0a3e1 (patch)
treeb21808ddd85a2114bea1502a6ec06b16894e0ef2 /app/models/environment.rb
parent0047869c27f0aede95f20de41c8498b7c23bf08d (diff)
downloadgitlab-ce-4d9ede0be7ea4dae92d224454616f9e65da0a3e1.tar.gz
Backport CE changes for Ops Dashboard in EE
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r--app/models/environment.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index 309bd4f37c9..0816c395185 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -48,6 +48,8 @@ class Environment < ActiveRecord::Base
order(Gitlab::Database.nulls_first_order("(#{max_deployment_id_sql})", 'ASC'))
end
scope :in_review_folder, -> { where(environment_type: "review") }
+ scope :for_name, -> (name) { where(name: name) }
+ scope :for_project, -> (project) { where(project_id: project) }
state_machine :state, initial: :available do
event :start do