Delete feedback#634
Merged
loiswells97 merged 9 commits intomainfrom Dec 5, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements the ability for teachers and school owners to delete feedback on student projects. The implementation adds a DELETE endpoint to the feedback API, updates authorization rules in CanCanCan, and includes comprehensive test coverage for different user roles.
Key Changes
- Added
destroyaction to the Feedback API that allows authorized users to delete feedback - Updated authorization rules to permit school owners to delete any feedback in their school and teachers to delete feedback for projects in their classes
- Created a new
Feedback::Deleteoperation following the repository's domain operation pattern
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| config/routes.rb | Added destroy to the feedback resources to expose the DELETE endpoint |
| app/controllers/api/feedback_controller.rb | Implemented destroy action that calls the Delete operation and returns appropriate status codes |
| app/models/ability.rb | Added :destroy permission for school owners (all school feedback) and teachers (class projects) |
| lib/concepts/feedback/delete.rb | Created Delete operation with error handling and Sentry integration |
| spec/models/ability_spec.rb | Added authorization tests verifying destroy permissions for different roles |
| spec/features/feedback/deleting_feedback_spec.rb | Added feature tests for successful deletion, forbidden access, and non-existent feedback scenarios |
| spec/concepts/feedback/delete_spec.rb | Added unit tests for the Delete operation covering success and failure cases |
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
What's changed?