diff options
author | Thong Kuah <tkuah@gitlab.com> | 2019-06-24 13:26:03 +1200 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2019-06-24 13:27:54 +1200 |
commit | 25adee56f76ec6e0faca1dc4d7fef36e88c19f3d (patch) | |
tree | 28a4f67180c9e9cc3422ec365ec79d2d83608093 /app/models/deployment.rb | |
parent | f89a33c9d13db824bb4f4618512d82b6c4e6515a (diff) | |
download | gitlab-ce-25adee56f76ec6e0faca1dc4d7fef36e88c19f3d.tar.gz |
Move innards of cluster method to environment
Environment already has a memoized deployment plaform.
No need to check for respond_to?(:cluster) now that all deployment
platforms are Clusters::Cluster.
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r-- | app/models/deployment.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb index 92c7311014a..23cc3f00527 100644 --- a/app/models/deployment.rb +++ b/app/models/deployment.rb @@ -85,11 +85,7 @@ class Deployment < ApplicationRecord end def cluster - platform = project.deployment_platform(environment: environment.name) - - if platform.present? && platform.respond_to?(:cluster) - platform.cluster - end + environment.deployment_platform&.cluster end def execute_hooks |