-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add User, School, Provider models and default scopes #31
Add User, School, Provider models and default scopes #31
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the new support_user_enabled
attribute, I have a few questions:
- Will a User be allowed multiple roles?
- Would we continue with this path to differentiate Provider users vs School users?
|
I was thinking that, yeah. I'm just not sure if it's necessary or not. 🤔 I do think it's more modifiable though. There is a small db performance tradeoff by separating this context into a separate table though. I have seen
I think the question is two-fold. 1) Are we planning to categorise users into School users vs Provider users? 2) If so, will we add an additional boolean attribute to signify those roles? |
I suppose we could keep it as a bool for now and it would be a straightforward migration to move it to a separate table later if we find it's necessary. Perhaps it is wise not to anticipate complexity that may not actually exist. I'm happy to go either way. @ollietreend do you have a view?
Thanks for the clarification! I don't see where that will be necessary. They will be users for whatever organisation they have a membership to. And since that is a polymorphic association, the school-ness or provider-ness of the will be implied. Does that sound ok? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good – nice work. It's really nice to see our thoughts & plans about service namespacing taking shape in reality.
I've added a few comments, and I've "requested changes" because I think at least a couple of my suggested changes would be useful.
db/migrate/20231216102842_add_index_to_users_on_email_and_service.rb
Outdated
Show resolved
Hide resolved
👍 I'm good with keeping it a boolean for now. I'd also drop the
👍 Sounds good to me for now. This means that a user can potentially belong to both a School and a Provider. |
ac61ad1
to
fbb80fb
Compare
c418a61
to
ed7c30f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me ✨ 🚀
74efd77
to
2e05f0b
Compare
Context
Setting up some of the basic data structures before proceeding with feature work.
I decided it made sense to do this as a separate PR before proceed with logging in as a support user.
Changes proposed in this pull request
No UI changes. The only change to existing functionality is to add the service to the seeded personas.
Guidance to review
Pull and run the migrations and seed the database.
Have a look at the erd in this PR -- they should reflect the agreed approach. #30
Note: Not everything in the erd is here -- I haven't included the membership model because that is outside of the scope of what I'm working on (support users will have access to all the schools and providers, not through membership). I can add it for completeness if people think it would be useful. Otherwise, happy for someone to do it when it becomes more relevant.
Link to Trello card
https://trello.com/c/SX3aODZS
Things to check
Screenshots