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-07-11 14:06:14 +0300
committerLin Jen-Shin <godfat@godfat.org>2016-07-11 14:06:14 +0300
commitdf5b78676e914ad8e14e96322b1dce383ae26875 (patch)
tree3492c472585018f755e8b506bb6b46ac20d92737 /app/controllers/projects/artifacts_controller.rb
parent2c27325e0683db7032786b1d0019b22f0cb90f89 (diff)
Using plain if/else is much easier to understand
Diffstat (limited to 'app/controllers/projects/artifacts_controller.rb')
-rw-r--r--app/controllers/projects/artifacts_controller.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb
index f71499be4f7..944fde11b09 100644
--- a/app/controllers/projects/artifacts_controller.rb
+++ b/app/controllers/projects/artifacts_controller.rb
@@ -5,11 +5,11 @@ class Projects::ArtifactsController < Projects::ApplicationController
before_action :validate_artifacts!
def download
- unless artifacts_file.file_storage?
- return redirect_to artifacts_file.url
+ if artifacts_file.file_storage?
+ send_file artifacts_file.path, disposition: 'attachment'
+ else
+ redirect_to artifacts_file.url
end
-
- send_file artifacts_file.path, disposition: 'attachment'
end
def browse