Enable guessing the anomaly notification that triggered the user feedback

This commit is contained in:
Maximilian Grundke
2018-08-03 13:20:31 +02:00
parent 3162764c81
commit fc3e9ed470

View File

@ -9,4 +9,9 @@ class UserExerciseFeedback < ActiveRecord::Base
def to_s
"User Exercise Feedback"
end
def anomaly_notification
AnomalyNotification.where({exercise_id: exercise.id, user_id: user_id, user_type: user_type})
.where("created_at < ?", created_at).order("created_at DESC").to_a.first
end
end