diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-08-17 17:38:38 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-08-17 17:38:38 +0800 |
commit | 4fbe044b74aa6a24133732ef8a9bc5063ecef5dd (patch) | |
tree | f274aab369b8b90e184b38a10fabe228e59e7973 /app/controllers | |
parent | ee33b3e6e84bb566e84062e70d45c6d84ace4ee7 (diff) | |
download | gitlab-ce-4fbe044b74aa6a24133732ef8a9bc5063ecef5dd.tar.gz |
Use switch case in a helper, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_13988401
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/artifacts_controller.rb | 10 |
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 |