Prefer if so it's more clear what's going on

This commit is contained in:
Lin Jen-Shin 2016-07-14 16:36:09 +08:00
parent 1c7871e92f
commit e01c421b91
1 changed files with 8 additions and 7 deletions

View File

@ -69,16 +69,17 @@ module API
authorize_read_builds!
build = get_build!(params[:build_id])
artifacts_file = build.artifacts_file
unless artifacts_file.file_storage?
return redirect_to build.artifacts_file.url
if !artifacts_file.file_storage?
redirect_to(build.artifacts_file.url)
elsif artifacts_file.exists?
present_file!(artifacts_file.path, artifacts_file.filename)
else
not_found!
end
return not_found! unless artifacts_file.exists?
present_file!(artifacts_file.path, artifacts_file.filename)
end
# Get a trace of a specific build of a project