ITT Mentor Services - Deactivate school
Purpose
This document describes how to 'deactivate' a school from either the claims and/or placements service.
This is not a process which can be performed within either live service. This code will need to be executed within the rails console on an Azure server running this service.
To connect to the Azure server, please follow the instructions Connect to an instance running in Azure
Deactivating the school from the claims service
SupportHelper.deactivate_school(school: school, claims_service: true)
(Assuming the school you wish to deactivate is assigned to the variable school)
Executing this code will perform the following:
- Destroy all
claimsassociated with theschool. - Destroy all
eligibilitiesassociated with theschool. - Destroy all
mentor_membershipsassociated with theschool. - Destroy all
user_membershipsassociated with theschool. - Update the
claims_serviceattribute on theschooltofalse.
This will effectively deactivate the school from the claims service.
:warning: Warning :warning:
If the school has associated claims, which are not in either the draft or submitted state.
Then school can not be deactivated from the claims service.
Deactivating the school from the placements service
SupportHelper.deactivate_school(school: school, placements_service: true)
(Assuming the school you wish to deactivate is assigned to the variable school)
Executing this code will perform the following:
- Destroy all
placementsassociated with theschool. - Destroy all
mentor_membershipsassociated with theschool. - Destroy all
user_membershipsassociated with theschool. - Destroy all
partnershipsassociated with theschool. - Destroy all
hosting_interestsassociated with theschool. - Update the
placements_serviceattribute on theschooltofalse.
This will effectively deactivate the school from the placements service.
:warning: Warning :warning:
If the school has associated placements, which are have been associated with a provider.
Then school can not be deactivated from the placements service.
Deactivating the school from both services
SupportHelper.deactivate_school(school: school, claims_service: true, placements_service: true)
Executing this code will perform all of the functions listed above for both services. This will effectively remove the school from both the claims and placements service.