Fix feedback page by accessing the contributor

Fixes CODEOCEAN-TE
This commit is contained in:
Sebastian Serth
2023-08-30 18:14:59 +02:00
parent a2d6b67a88
commit 094aba096c

View File

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