Fix Rubocop offenses
This commit is contained in:
@ -185,7 +185,7 @@ class ExercisesController < ApplicationController
|
|||||||
|
|
||||||
def user_from_api_key
|
def user_from_api_key
|
||||||
authorization_header = request.headers['Authorization']
|
authorization_header = request.headers['Authorization']
|
||||||
api_key = authorization_header&.split(' ')&.second
|
api_key = authorization_header&.split&.second
|
||||||
user_by_codeharbor_token(api_key)
|
user_by_codeharbor_token(api_key)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -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}" }
|
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 = 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}" }
|
Rails.logger.debug { "review exercise #{ex.id} diff: #{ex.expected_difficulty}" }
|
||||||
if (ex.expected_difficulty - highest_difficulty_user_has_accessed) <= 1
|
if (ex.expected_difficulty - highest_difficulty_user_has_accessed) <= 1
|
||||||
Rails.logger.debug { "matched exercise #{ex.id}" }
|
Rails.logger.debug { "matched exercise #{ex.id}" }
|
||||||
|
Reference in New Issue
Block a user