You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the school_classes table (see rejected_at on the schools table as an example)
Update SchoolClassesController:destroy to implement a soft (logical) delete, utilising the deleted_at field, this should be null 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
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
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:
deleted_at
field with a timestamp to theschool_classes
table (seerejected_at
on theschools
table as an example)SchoolClassesController:destroy
to implement a soft (logical) delete, utilising thedeleted_at
field, this should benull
by defaultThe text was updated successfully, but these errors were encountered: