Commit afa5afc5 authored by tiagonbotelho's avatar 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 @@
This build is the most recent deployment to #{environment_link_for_build(@build.project, @build)}.
- else
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)}.
- elsif @build.complete? && !@build.success?
The deployment of this build to #{environment_link_for_build(@build.project, @build)} did not succeed.
- else
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
= 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