Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-24 18:09:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-24 18:09:19 +0300
commit036de5f31f136a7482f9e2b1d1e98a9c4b45ea80 (patch)
tree6e32fae7b756a9bd712158856b47e7dd3bf7827d /app/models
parenta46b489e175708cc64fc5198f458f927558f11ba (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/deployment.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb
index f000e474605..5b3671923cc 100644
--- a/app/models/deployment.rb
+++ b/app/models/deployment.rb
@@ -243,19 +243,16 @@ class Deployment < ApplicationRecord
def previous_deployment
@previous_deployment ||=
- project.deployments.joins(:environment)
- .where(environments: { name: self.environment.name }, ref: self.ref)
- .where.not(id: self.id)
+ self.class.for_environment(environment_id)
+ .where(ref: ref)
+ .where.not(id: id)
.order(id: :desc)
.take
end
def previous_environment_deployment
- project
- .deployments
+ self.class.for_environment(environment_id)
.success
- .joins(:environment)
- .where(environments: { name: environment.name })
.where.not(id: self.id)
.order(id: :desc)
.take