From fd221259e389f4066b9368e3aff0a3e9f91f9e70 Mon Sep 17 00:00:00 2001 From: Splines Date: Thu, 22 Aug 2024 17:01:06 +0200 Subject: [PATCH] Always show annotations visible to teacher (should not be dependent on whether NEW annotations can be posted with the teacher or not) --- app/controllers/annotations_controller.rb | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/app/controllers/annotations_controller.rb b/app/controllers/annotations_controller.rb index 67d579757..6e6ea47b7 100644 --- a/app/controllers/annotations_controller.rb +++ b/app/controllers/annotations_controller.rb @@ -91,17 +91,8 @@ def destroy def update_annotations medium = Medium.find_by(id: params[:mediumId]) - # Get the right annotations - annotations = if medium.annotations_visible?(current_user) - Annotation.where(medium: medium, - visible_for_teacher: true).or( - Annotation.where(medium: medium, - user: current_user) - ) - else - Annotation.where(medium: medium, - user: current_user) - end + annotations = Annotation.where(medium: medium, visible_for_teacher: true) + .or(Annotation.where(medium: medium, user: current_user)) # If annotation is associated to a comment, # the field "comment" is empty -> get it from the commontator comment