Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-08-17 12:38:38 +0300
committerLin Jen-Shin <godfat@godfat.org>2016-08-17 12:38:38 +0300
commit4fbe044b74aa6a24133732ef8a9bc5063ecef5dd (patch)
treef274aab369b8b90e184b38a10fabe228e59e7973 /app/controllers/projects/artifacts_controller.rb
parentee33b3e6e84bb566e84062e70d45c6d84ace4ee7 (diff)
Use switch case in a helper, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_13988401
Diffstat (limited to 'app/controllers/projects/artifacts_controller.rb')
-rw-r--r--app/controllers/projects/artifacts_controller.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb
index 5cc6d643b64..8261a73c642 100644
--- a/app/controllers/projects/artifacts_controller.rb
+++ b/app/controllers/projects/artifacts_controller.rb
@@ -35,14 +35,10 @@ class Projects::ArtifactsController < Projects::ApplicationController
end
def latest_succeeded
- path = params[:path]
+ target_url = artifacts_action_url(params[:path], project, build)
- if %w[download browse file].include?(path)
- redirect_to send(
- "#{path}_namespace_project_build_artifacts_url",
- project.namespace,
- project,
- build)
+ if target_url
+ redirect_to(target_url)
else
render_404
end