Fix exercise anomaly detection

* The SQL query and mail template was erroneous
* Including the `url_helpers` influenced the specs due different url helpers within the specs. Test by executing `rspec './spec/db/seeds_spec.rb[1:1:1]' './spec/features/request_for_comments_filter_spec.rb[1:1]' -f progress --fail-fast --seed 55564`
This commit is contained in:
Sebastian Serth
2021-03-22 18:48:31 +01:00
parent 076812b2e7
commit 9485c15c57
2 changed files with 7 additions and 9 deletions

View File

@ -12,9 +12,9 @@ table(border=1)
- @anomalies.keys.each do | id |
- exercise = Exercise.find(id)
tr
td = link_to_if(policy(@user, exercise).show?, exercise.title, exercise_path(exercise))
td = link_to_if(ExercisePolicy.new(@user, exercise).show?, exercise.title, exercise_url(exercise))
td = @anomalies[id]
td = link_to_if(policy(@user, exercise).statistics?, t('shared.statistics', locale: :de), statistics_exercise_path(exercise))
td = link_to_if(ExercisePolicy.new(@user, exercise).statistics?, t('shared.statistics', locale: :de), statistics_exercise_url(exercise))
== t('mailers.user_mailer.exercise_anomaly_detected.body2',
@ -31,8 +31,8 @@ table(border=1)
- @anomalies.keys.each do | id |
- exercise = Exercise.find(id)
tr
td = link_to_if(policy(@user, exercise).show?, exercise.title, exercise_path(exercise))
td = link_to_if(ExercisePolicy.new(@user, exercise).show?, exercise.title, exercise_url(exercise))
td = @anomalies[id]
td = link_to_if(policy(@user, exercise).statistics?, t('shared.statistics', locale: :en), statistics_exercise_path(exercise))
td = link_to_if(ExercisePolicy.new(@user, exercise).statistics?, t('shared.statistics', locale: :en), statistics_exercise_url(exercise))
== t('mailers.user_mailer.exercise_anomaly_detected.body3')