From 5b654debbe3af46e98940ee51b3dddf3982572d5 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Tue, 12 Dec 2023 10:40:45 +0100 Subject: [PATCH] Fix Rubocop offenses --- app/controllers/exercises_controller.rb | 2 +- app/models/proxy_exercise.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index 257d9fe6..2fc49897 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -185,7 +185,7 @@ class ExercisesController < ApplicationController def user_from_api_key authorization_header = request.headers['Authorization'] - api_key = authorization_header&.split(' ')&.second + api_key = authorization_header&.split&.second user_by_codeharbor_token(api_key) end diff --git a/app/models/proxy_exercise.rb b/app/models/proxy_exercise.rb index 8d9c6517..9ba4e7a0 100644 --- a/app/models/proxy_exercise.rb +++ b/app/models/proxy_exercise.rb @@ -151,7 +151,7 @@ class ProxyExercise < ApplicationRecord Rails.logger.debug { "select most appropiate exercise for user. his highest difficulty was #{highest_difficulty_user_has_accessed}" } sorted_exercises = relative_knowledge_improvement.sort_by {|_k, v| v }.reverse - sorted_exercises.each do |ex, _diff| + sorted_exercises.each do |ex, _diff| # rubocop:disable Style/HashEachMethods Rails.logger.debug { "review exercise #{ex.id} diff: #{ex.expected_difficulty}" } if (ex.expected_difficulty - highest_difficulty_user_has_accessed) <= 1 Rails.logger.debug { "matched exercise #{ex.id}" }