Skip to content

Conversation

@adrian-rpf
Copy link
Contributor

Status

  • Closes add issue numbers or delete
  • Related to add issue numbers or delete

Points for consideration:

  • Security
  • Performance

What's changed?

  • Project.users: Refactored to correctly fetch student users for multiple schools by grouping user IDs per school and making individual API calls, preventing data loss when projects span different schools.
  • SchoolClass.with_teachers: Corrected the scope to filter on class_teachers.teacher_id instead of teachers.id to accurately identify teachers associated with a class, resolving false negatives.
  • StudentRemovalService: Modified to only skip student removal if projects exist within the current school and optimized the check using .exists? to prevent unnecessary data loading and ensure students without in-school work can be removed.

Steps to perform after deploying to production

If the production environment requires any extra work after this PR has been deployed detail it here. This could be running a Rake task, a migration, or upgrading a Gem. That kind of thing.


Open in Cursor Open in Web

Co-authored-by: adrian.lansdown <adrian.lansdown@raspberrypi.org>
@cursor
Copy link

cursor bot commented Nov 11, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@cla-bot
Copy link

cla-bot bot commented Nov 11, 2025

We require contributors to sign our Contributor License Agreement, and we don't have you on file. In order for us to review and merge your code, please complete this form and we'll get you added and review your contribution as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants