Always use user object instead of ID and Type

This commit is contained in:
Sebastian Serth
2023-08-25 23:59:24 +02:00
parent 8ba5d5a984
commit 235bf771fe
11 changed files with 16 additions and 28 deletions

View File

@ -17,7 +17,7 @@ class UserExerciseFeedback < ApplicationRecord
end
def anomaly_notification
AnomalyNotification.where({exercise_id: exercise.id, user_id:, user_type:})
AnomalyNotification.where({exercise_id: exercise.id, user:})
.where('created_at < ?', created_at).order('created_at DESC').to_a.first
end
end