diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-09 09:09:10 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-09 09:09:10 +0000 |
commit | 7484851b5f762fad81ddecb4735d22828e205af1 (patch) | |
tree | b7e5da6212d2b32626b9b3d70c9089b98d05bb92 /app/models/deployment.rb | |
parent | 760822a53715549c2f115370ed24a19db1b7d63a (diff) | |
download | gitlab-ce-7484851b5f762fad81ddecb4735d22828e205af1.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r-- | app/models/deployment.rb | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb index 9bcc6fd90b2..0bfe6172154 100644 --- a/app/models/deployment.rb +++ b/app/models/deployment.rb @@ -240,18 +240,10 @@ class Deployment < ApplicationRecord def previous_deployment @previous_deployment ||= self.class.for_environment(environment_id) - .where(ref: ref) - .where.not(id: id) - .order(id: :desc) - .take - end - - def previous_environment_deployment - self.class.for_environment(environment_id) - .success - .where.not(id: self.id) - .order(id: :desc) - .take + .success + .where('id < ?', id) + .order(id: :desc) + .take end def stop_action |