Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Pilot Slugs on Site Settings Change #87

Open
memchk opened this issue Jun 9, 2020 · 1 comment
Open

Update Pilot Slugs on Site Settings Change #87

memchk opened this issue Jun 9, 2020 · 1 comment
Assignees
Labels
bug Something isn't working ruby Pull requests that update Ruby code

Comments

@memchk
Copy link
Contributor

memchk commented Jun 9, 2020

Currently, if you change the "Organization ICAO" in the settings page, this does not update any existing users friendly_ids. This causes URLs to be inconsistant.

Reproduce:

  1. rails db:reset db:seed skyos:install
  2. Fill in default user
  3. Change the Organizational ICAO from "ORG" to "ABC"
  4. Logbook URL will show for PID 100 "ORG100" while profile data shows "ABC100"

Screenshot:

image

@memchk memchk added bug Something isn't working ruby Pull requests that update Ruby code labels Jun 9, 2020
@memchk memchk self-assigned this Jun 9, 2020
@jvoss
Copy link
Contributor

jvoss commented Jun 10, 2020

Currently the only mechanism to get the Pilot ID to regenerate the slug would be to go into user management and save each user again (even with no changes).

A hook when changing the organization ICAO will need to be written to trigger slug regeneration on each user.

This would likely need to be done in the Setting model of which functionality is provided by rails-settings-cached. Further investigation is needed to know whether all standard callbacks and change detection is available here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ruby Pull requests that update Ruby code
Projects
None yet
Development

No branches or pull requests

2 participants