Send email to user associated with exercise collection when anomalies are detected

This commit is contained in:
Maximilian Grundke
2017-12-10 18:36:24 +01:00
parent 339a89107f
commit 351f553c60
5 changed files with 80 additions and 1 deletions

View File

@ -37,7 +37,8 @@ namespace :detect_exercise_anomalies do
anomalies = working_times.select do |exercise_id, working_time|
working_time > average * MAX_TIME_FACTOR or working_time < average * MIN_TIME_FACTOR
end
puts anomalies
UserMailer.exercise_anomaly_detected(collection, anomalies).deliver_now
end
end