BigW Consortium Gitlab

Commit afa5afc5 by tiagonbotelho

changes environment.last_deployment to a try expression so it does not fail if…

changes environment.last_deployment to a try expression so it does not fail if environment is not yet set
parent b1b5060d
...@@ -40,13 +40,13 @@ ...@@ -40,13 +40,13 @@
This build is the most recent deployment to #{environment_link_for_build(@build.project, @build)}. This build is the most recent deployment to #{environment_link_for_build(@build.project, @build)}.
- else - else
This build is an out-of-date deployment to #{environment_link_for_build(@build.project, @build)}. This build is an out-of-date deployment to #{environment_link_for_build(@build.project, @build)}.
- if environment.last_deployment - if environment.try(:last_deployment)
View the most recent deployment #{deployment_link(environment.last_deployment)}. View the most recent deployment #{deployment_link(environment.last_deployment)}.
- elsif @build.complete? && !@build.success? - elsif @build.complete? && !@build.success?
The deployment of this build to #{environment_link_for_build(@build.project, @build)} did not succeed. The deployment of this build to #{environment_link_for_build(@build.project, @build)} did not succeed.
- else - else
This build is creating a deployment to #{environment_link_for_build(@build.project, @build)} This build is creating a deployment to #{environment_link_for_build(@build.project, @build)}
- if environment.last_deployment - if environment.try(:last_deployment)
and will overwrite the and will overwrite the
= link_to 'latest deployment', deployment_link(environment.last_deployment) = link_to 'latest deployment', deployment_link(environment.last_deployment)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment