diff options
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 |