Change an organisation's slug
Note
For Worldwide Organisations, only steps 1 and 5 below need to be performed.
The organisation slug is used as a foreign key for organisations across multiple apps.
1. Change the organisation’s slug in Whitehall
Run the appropriate rake task:
- Organisation:
rake reslug:organisation['old-slug','new-slug']
- Worldwide Organisation:
rake reslug:worldwide_organisation['old-slug','new-slug']
Note: it’s important that single-quotes are used in the tasks otherwise they will fail.
2. Update the organisation in transition/transition-config:
The transition-config repo may contain slugs. Change any references to the old slug:
- Search the codebase for the slug
- Update the slugs
- Open a pull request, and get it reviewed and merged
Merging will trigger the changes to be imported automatically.
3. Update the organisation slug in Manuals Publisher
Find out if any manuals are published by this organisation, by running the following in the Manuals Publisher Rails console:
ManualRecord.where(organisation_slug: "old-slug").exists?
If there are, create a migration to update the slugs. Republish all affected manuals after deploying your change.
4. Sync the organisations with Signon
Signon assigns users to organisations. This is used by apps such as Whitehall for authorisation.
To sync all organisations from Whitehall to Signon, run the Signon rake task
rake organisations:fetch
. Users may have to log out and in again to pick up
permissions for the renamed organisation.
5. Update any best bet searches in Search Admin
Search the best bets in search-admin for references to the old organisation name and update them.