Fix rubocop offenses - Requires Ruby 3.1+

This commit is contained in:
Sebastian Serth
2022-11-25 10:53:14 +01:00
parent bdf474e684
commit 574e99eddd
93 changed files with 315 additions and 315 deletions

View File

@@ -11,7 +11,7 @@ module CommonBehavior
notice = result if result.present?
end
path = options[:path].try(:call) || @object
respond_with_valid_object(format, notice: notice, path: path, status: :created)
respond_with_valid_object(format, notice:, path:, status: :created)
else
respond_with_invalid_object(format, template: :new)
end
@@ -51,7 +51,7 @@ module CommonBehavior
notice = result if result.present?
end
path = options[:path] || @object
respond_with_valid_object(format, notice: notice, path: path, status: :ok)
respond_with_valid_object(format, notice:, path:, status: :ok)
else
respond_with_invalid_object(format, template: :edit)
end

View File

@@ -16,14 +16,14 @@ module FileConversion
path = File.dirname(file['name']).sub(%r{^(?>\./|\.)}, '').presence
file_type = all_file_types.detect {|ft| ft.file_extension == extension } || FileType.new(file_extension: extension)
CodeOcean::File.new(
name: name,
path: path,
name:,
path:,
size: file['size'],
owner: file['owner'],
group: file['group'],
permissions: file['permissions'],
updated_at: file['modificationTime'],
file_type: file_type
file_type:
)
end
[augment_files_for_download(files), directories]

View File

@@ -124,7 +124,7 @@ module RedirectBehavior
session: session.to_hash,
submission: @submission.inspect,
params: params.as_json,
current_user: current_user,
current_user:,
lti_exercise_id: session[:lti_exercise_id],
lti_parameters_id: session[:lti_parameters_id]
)