Save 36% for Black Friday! Learn more

Andre Goldstein

Joined

90 Experience
0 Lessons Completed
0 Questions Solved

Activity

Thanks for the clarification! Sometimes it's nice to hear opinionated advice!

Thanks Chris, I think the niggles I'm having setting up multi-tenancy right now along with your advice is pushing me in the direction of ploughing ahead with the slightly fiddly queries!

Thanks Chris,

I think it is a little different as I'm trying to plan ahead in the case where I'd want to make the "student" part of the app as fully-featured as the teacher part (eg: combined lesson calendar that sort of thing).

If the teacher remains the main target for the app then I think the normal multi-tenant setup you describe could work well. The only limitation being the student will have to login individually per teacher (in case they had several teachers on the same platform) as opposed to having a combined view of all their teachers.

Now running into a few issues with login/sessions, which I will have to overcome to keep going the multi-tenant route, it already feels a little brittle compared to the usual simplicity of Rails :D

Thanks again

Thanks Chris that's really helpful, couple of questions if I may!

Just to confirm, so in your above example a UserAccount would have one account and one user?

My main confusion at the moment is how to replicate what I currently have where I have a Teacher model and a Student Model (which are both Devise models under the hood), do you think it would be best to maintain a single User model instead if going with the multi-tenancy approach?

I guess I'm trying to see how a student would have access to a Tenant but only as a student, not as a teacher.

Thanks again for the input!

Hey guys,

Have been watching some great videos on multi-tenancy with Rails but one thing I can't quite get my head around.

If a User remains global, what is the best strategy for giving them access to a specific tenant(s)?

If I add a foreign_key relationship, to the Tenant model then how would you allow a user to belong to more than one tenant?

Any pointers much appreciated! Thanks!

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2021 GoRails, LLC. All rights reserved.