From 87f280089d76efaf79132fdf91daff572dc43220 Mon Sep 17 00:00:00 2001 From: Maximilian Grundke Date: Wed, 25 Oct 2017 12:07:16 +0200 Subject: [PATCH] Fix return value of logger being assigned to exercise --- app/models/proxy_exercise.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/proxy_exercise.rb b/app/models/proxy_exercise.rb index 5922e062..5bdff20d 100644 --- a/app/models/proxy_exercise.rb +++ b/app/models/proxy_exercise.rb @@ -37,8 +37,8 @@ class ProxyExercise < ActiveRecord::Base assigned_user_proxy_exercise.exercise else matching_exercise = - Rails.logger.debug("find new matching exercise for user #{user.id}" ) begin + Rails.logger.debug("find new matching exercise for user #{user.id}" ) find_matching_exercise(user) rescue => e #fallback Rails.logger.error("finding matching exercise failed. Fall back to random exercise! Error: #{$!}" ) @@ -85,8 +85,7 @@ class ProxyExercise < ActiveRecord::Base @reason[:reason] = "easiest exercise in pool. empty potential exercises" select_easiest_exercise(exercises) else - recommended_exercise = select_best_matching_exercise(user, exercises_user_has_accessed, potential_recommended_exercises) - recommended_exercise + select_best_matching_exercise(user, exercises_user_has_accessed, potential_recommended_exercises) end end @@ -238,4 +237,4 @@ class ProxyExercise < ActiveRecord::Base exercises.order(:expected_difficulty).first end -end \ No newline at end of file +end