fixed multiple style guide violations

This commit is contained in:
Hauke Klement
2015-02-17 10:23:01 +01:00
parent cb87870a46
commit a13d1738e2
32 changed files with 56 additions and 64 deletions

View File

@ -1,5 +1,5 @@
module CommonBehavior
def create_and_respond(options = {}, &block)
def create_and_respond(options = {})
@object = options[:object]
respond_to do |format|
if @object.save

View File

@ -2,8 +2,8 @@ module SubmissionParameters
include FileParameters
def reject_illegal_file_attributes!(submission_params)
if exercise = Exercise.find_by(id: submission_params[:exercise_id])
submission_params[:files_attributes].try(:reject!) do |index, file_attributes|
if Exercise.exists?(id: submission_params[:exercise_id])
submission_params[:files_attributes].try(:reject!) do |_, file_attributes|
file = CodeOcean::File.find_by(id: file_attributes[:file_id])
file.nil? || file.hidden || file.read_only
end

View File

@ -24,7 +24,7 @@ class ExecutionEnvironmentsController < ApplicationController
end
def execute_command
@docker_client = DockerClient.new(execution_environment: @execution_environment, user: current_user)
@docker_client = DockerClient.new(execution_environment: @execution_environment)
render(json: @docker_client.execute_arbitrary_command(params[:command]))
end

View File

@ -9,7 +9,7 @@ class SessionsController < ApplicationController
skip_before_action :verify_authenticity_token, only: :create_through_lti
def create
if user = login(params[:email], params[:password], params[:remember_me])
if login(params[:email], params[:password], params[:remember_me])
redirect_back_or_to(:root, notice: t('.success'))
else
flash.now[:danger] = t('.failure')

View File

@ -72,7 +72,7 @@ class SubmissionsController < ApplicationController
end
def set_docker_client
@docker_client = DockerClient.new(execution_environment: @submission.execution_environment, user: current_user)
@docker_client = DockerClient.new(execution_environment: @submission.execution_environment)
end
private :set_docker_client