diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2016-12-07 13:34:00 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2016-12-07 13:55:02 +0300 |
commit | 2dc907bc1761499e27c0a75eeccbbd350b38f80e (patch) | |
tree | cc569cb719bbdece5deab9a89513a0171f31bddf /app/helpers | |
parent | 19e1b3246dfe085ef604c820e3bc8263e5bffd43 (diff) |
Changes after review
Fix error
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/environment_helper.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/app/helpers/environment_helper.rb b/app/helpers/environment_helper.rb index 5fde912ab2c..96d6f64eb8e 100644 --- a/app/helpers/environment_helper.rb +++ b/app/helpers/environment_helper.rb @@ -14,16 +14,14 @@ module EnvironmentHelper end end - def deployment_link(deployment) + def deployment_link(deployment, text) return unless deployment - link_to "##{deployment.iid}", [deployment.project.namespace.becomes(Namespace), deployment.project, deployment.deployable] - end - - def last_deployment_link(deployment, link_text) - return unless deployment - - link_to link_text, [deployment.project.namespace.becomes(Namespace), deployment.project, deployment.deployable] + 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 end def last_deployment_link_for_environment_build(project, build) |