Open
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_at
field with a timestamp to theschool_classes
table (seerejected_at
on theschools
table as an example) - Update
SchoolClassesController:destroy
to implement a soft (logical) delete, utilising thedeleted_at
field, this should benull
by 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