Upgrade Rails to version 5.2.1 and adopt code & specs where necessary
Signed-off-by: Sebastian Serth <Sebastian.Serth@student.hpi.de>
This commit is contained in:
@ -115,7 +115,7 @@ class SubmissionsController < ApplicationController
|
||||
if @file.native_file?
|
||||
send_file(@file.native_file.path, disposition: 'inline')
|
||||
else
|
||||
render(text: @file.content)
|
||||
render(plain: @file.content)
|
||||
end
|
||||
end
|
||||
|
||||
@ -140,7 +140,7 @@ class SubmissionsController < ApplicationController
|
||||
# probably add:
|
||||
# ensure
|
||||
# #guarantee that the thread is releasing the DB connection after it is done
|
||||
# ActiveRecord::Base.connectionpool.releaseconnection
|
||||
# ApplicationRecord.connectionpool.releaseconnection
|
||||
# end
|
||||
Thread.new { EventMachine.run } unless EventMachine.reactor_running? && EventMachine.reactor_thread.alive?
|
||||
|
||||
@ -329,7 +329,7 @@ class SubmissionsController < ApplicationController
|
||||
|
||||
def set_file
|
||||
@file = @files.detect { |file| file.name_with_extension == params[:filename] }
|
||||
render(nothing: true, status: 404) unless @file
|
||||
head :not_found unless @file
|
||||
end
|
||||
private :set_file
|
||||
|
||||
@ -362,7 +362,7 @@ class SubmissionsController < ApplicationController
|
||||
DockerClient.destroy_container(container)
|
||||
rescue Docker::Error::NotFoundError
|
||||
ensure
|
||||
render(nothing: true)
|
||||
head :ok
|
||||
end
|
||||
|
||||
def store_error(stderr)
|
||||
|
Reference in New Issue
Block a user