diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /app/models/preloaders/environments/deployment_preloader.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'app/models/preloaders/environments/deployment_preloader.rb')
-rw-r--r-- | app/models/preloaders/environments/deployment_preloader.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/preloaders/environments/deployment_preloader.rb b/app/models/preloaders/environments/deployment_preloader.rb index 251d1837f19..84aa7bc834f 100644 --- a/app/models/preloaders/environments/deployment_preloader.rb +++ b/app/models/preloaders/environments/deployment_preloader.rb @@ -41,11 +41,11 @@ module Preloaders environment.association(association_name).target = associated_deployment environment.association(association_name).loaded! - if associated_deployment - # `last?` in DeploymentEntity requires this environment to be loaded - associated_deployment.association(:environment).target = environment - associated_deployment.association(:environment).loaded! - end + next unless associated_deployment + + # `last?` in DeploymentEntity requires this environment to be loaded + associated_deployment.association(:environment).target = environment + associated_deployment.association(:environment).loaded! end end end |