Skip to content

Commit

Permalink
Simplify DB request for checking if the current user is a student of …
Browse files Browse the repository at this point in the history
…the group
  • Loading branch information
mpugach committed Dec 24, 2023
1 parent 1f69696 commit 436509b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/policies/academic_group_policy.rb
Expand Up @@ -18,6 +18,6 @@ def attendance_template_pdf?
private

def student_of_the_group?
record.active_students.map(&:id).include?(user.id)
record.active_students.where(id: user.id).any?
end
end

0 comments on commit 436509b

Please sign in to comment.