Using plain if/else is much easier to understand

This commit is contained in:
Lin Jen-Shin 2016-07-11 19:06:14 +08:00
parent 2c27325e06
commit df5b78676e

View file

@ -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