-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
There is an existing destroy method on SchoolClassesController, but this does not meet our requirements so will need changing (along with the associated tests).
The following changes are needed to meet the requirements:
- Add a migration inserting a
deleted_atfield with a timestamp to theschool_classestable (seerejected_aton theschoolstable as an example) - Update
SchoolClassesController:destroyto implement a soft (logical) delete, utilising thedeleted_atfield, this should benullby default - Update abilities:
- Owners can delete a single class created by any user
- Teachers can delete a single class that they have teacher permission for
- Exclude classes where the deleted_at flag is non null, to prevent deleted classes being returned anywhere in the api
- Tests