Remove unused school deletion endpoint#930
Merged
Merged
Conversation
This isn't accessible from the UI so is a risk if it is used because it might lead to unexpected behaviour. I also searched our logs and have no record of schools being destroyed.
zetter-rpf
marked this pull request as ready for review
July 21, 2026 07:57
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the ability for API consumers to delete (DELETE) schools, eliminating an unused but potentially risky endpoint from the Rails API surface.
Changes:
- Removed
DELETE /api/schools/:idroute and the correspondingApi::SchoolsController#destroyaction. - Removed the
School::Deleteoperation and its associated request/unit specs. - Updated cancancan abilities to no longer grant school owners
:destroyonSchool.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spec/models/ability_spec.rb | Updates authorization expectations for school owners (but should also assert :destroy is no longer allowed). |
| spec/features/school/deleting_a_school_spec.rb | Removes request spec coverage for the deleted endpoint. |
| spec/concepts/school/delete_spec.rb | Removes unit spec coverage for the deleted School::Delete operation. |
| lib/concepts/school/operations/delete.rb | Removes the School::Delete operation implementation. |
| config/routes.rb | Removes destroy from API schools routes, disabling DELETE /api/schools/:id. |
| app/models/ability.rb | Removes :destroy permission on School for school owners. |
| app/controllers/api/schools_controller.rb | Removes the destroy action that previously deleted schools. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test coverage92.17% line coverage reported by SimpleCov. |
raspberrypiherokubot
temporarily deployed
to
editor-api-p-remove-unu-hul6q6
July 21, 2026 08:03
Inactive
jamiebenstead
approved these changes
Jul 21, 2026
jamiebenstead
left a comment
Contributor
There was a problem hiding this comment.
Looks good! Nice spot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
This isn't accessible from the UI so is a risk if it is used because it might lead to unexpected behaviour.
I also searched our logs and have no record of schools being destroyed.