diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2016-12-07 18:27:22 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2016-12-07 18:43:24 +0300 |
commit | 4eb53036c7469d027d2a75aff9e70950557195d2 (patch) | |
tree | acfe7f47c3a9f0323e1d1fbc13a9d36f7191d932 /app | |
parent | 2dc907bc1761499e27c0a75eeccbbd350b38f80e (diff) |
Changes after review
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/environment_helper.rb | 10 | ||||
-rw-r--r-- | app/views/projects/builds/show.html.haml | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/app/helpers/environment_helper.rb b/app/helpers/environment_helper.rb index 96d6f64eb8e..ff8550439d0 100644 --- a/app/helpers/environment_helper.rb +++ b/app/helpers/environment_helper.rb @@ -14,14 +14,12 @@ module EnvironmentHelper end end - def deployment_link(deployment, text) + def deployment_link(deployment, text: nil) return unless deployment - if text - link_to text, [deployment.project.namespace.becomes(Namespace), deployment.project, deployment.deployable] - else - link_to "##{deployment.iid}", [deployment.project.namespace.becomes(Namespace), deployment.project, deployment.deployable] - end + link_label = text ? text : "##{deployment.iid}" + + link_to link_label, [deployment.project.namespace.becomes(Namespace), deployment.project, deployment.deployable] end def last_deployment_link_for_environment_build(project, build) diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml index 3ef46872199..cdeb81372ee 100644 --- a/app/views/projects/builds/show.html.haml +++ b/app/views/projects/builds/show.html.haml @@ -46,7 +46,7 @@ - else This build is creating a deployment to #{environment_link_for_build(@build.project, @build)} - if environment.try(:last_deployment) - and will overwrite the #{deployment_link(environment.last_deployment, 'latest deployment')} + and will overwrite the #{deployment_link(environment.last_deployment, text: 'latest deployment')} .prepend-top-default - if @build.erased? |