Skip to content

Archive schools#908

Draft
zetter-rpf wants to merge 4 commits into
mainfrom
archive-schools
Draft

Archive schools#908
zetter-rpf wants to merge 4 commits into
mainfrom
archive-schools

Conversation

@zetter-rpf

Copy link
Copy Markdown
Contributor

Status

  • Closes add issue numbers or delete
  • Related to add issue numbers or delete

Points for consideration:

  • Security
  • Performance

What's changed?

Description of what's been done - bullets are often best

Steps to perform after deploying to production

If the production environment requires any extra work after this PR has been deployed detail it here. This could be running a Rake task, a migration, or upgrading a Gem. That kind of thing.

Many school owners contact us because they have created a school that is not being used. Because they are an owner/teacher on this school it prevents them from joining a new school.

Add the ability for admins to archive a school.

I considered using the existing rejected_at flag but this was modellling a different that we want to keep historical data for. Instead I'll add a 'hidden?' method to group this behaviour together.
When we are manually doing this we tend to delete all the roles for the school. This isn't ideal as it's hard to recover from or later use that data in the datawarehouse or sync to salesforce. Instead add an 'archived_at' column that we can use to keep the data around.

I think this is a good use of a default scope - it would be dangerous if we were allowing archived roles to access data so it's safer to block them.

I've chosen not to archive students as we already have a deletion process for them that the owner can do before requesting the school to be removed. Also, most of the requests for deletions are duplicate schools that have no students.
@cla-bot cla-bot Bot added the cla-signed label Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Test coverage

92.09% line coverage reported by SimpleCov.
Run: https://github.com/RaspberryPiFoundation/editor-api/actions/runs/28671555067

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants