diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-10-02 17:01:26 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-10-02 17:01:26 +0000 |
commit | 48c911b75e96563991387dc1c7b3aaa071d511cc (patch) | |
tree | 922137e8f162cf74b3965fc39ac1913b1049f0f5 /app/controllers/projects/artifacts_controller.rb | |
parent | c0a982fad665e28769967b17eddd90900f62be78 (diff) | |
download | gitlab-ce-48c911b75e96563991387dc1c7b3aaa071d511cc.tar.gz |
CE Resolve "Refactor code quality similar to JUnit tests"
Diffstat (limited to 'app/controllers/projects/artifacts_controller.rb')
-rw-r--r-- | app/controllers/projects/artifacts_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb index bd110d646e5..d0f59aa8162 100644 --- a/app/controllers/projects/artifacts_controller.rb +++ b/app/controllers/projects/artifacts_controller.rb @@ -14,6 +14,8 @@ class Projects::ArtifactsController < Projects::ApplicationController before_action :entry, only: [:file] def download + return render_404 unless artifacts_file + send_upload(artifacts_file, attachment: artifacts_file.filename) end @@ -100,7 +102,7 @@ class Projects::ArtifactsController < Projects::ApplicationController # rubocop: enable CodeReuse/ActiveRecord def artifacts_file - @artifacts_file ||= build.artifacts_file + @artifacts_file ||= build.artifacts_file_for_type(params[:file_type] || :archive) end def entry |