diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-07-11 19:06:14 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-07-11 19:06:14 +0800 |
commit | df5b78676e914ad8e14e96322b1dce383ae26875 (patch) | |
tree | 3492c472585018f755e8b506bb6b46ac20d92737 /app/controllers/projects/artifacts_controller.rb | |
parent | 2c27325e0683db7032786b1d0019b22f0cb90f89 (diff) | |
download | gitlab-ce-df5b78676e914ad8e14e96322b1dce383ae26875.tar.gz |
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.rb | 8 |
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 |