We've moved discussions to Discord

Request membership in addition to invitations

Joe Tebaldi
I'm using the multitenant branch and trying to create the functionality for a user to request membership to an account/team. So as a user, I would be able to see impersonal accounts/teams that have been created by other users and request membership. It would then populate in a table under account invitations on the account/team owner's side where they can select "approve" or "deny". I'm still learning so I'd love any advice on a good approach... thanks!
Chris Oliver
Accounts are something I would recommend reserving for billing and account ownership types of things, so I probably would recommend doing this.

In your gym example, I would treat the Account as a gym, and the AccountUsers as employees of the gym. Then you would want to create a GymMember model for people who want to join a gym. It would be a similar join table to AccountUser where it belongs_to :user and belongs_to :account but because it's separate, it'll be clear in your code that these are customers, not employees of the gym.

Does that make sense?
Joe Tebaldi
I think so! Let me make sure I understand...

I was trying to figure out how I would handle roles...  In your suggestion, should a gym owner be admin: false and change the current member role to staff

Lastly, would I still be able to leverage the invitation function so a gym owner/staff could invite members?
Chris Oliver
I was actually suggesting creating a separate model in Rails for GymMembers.

The reason being that you will need the Gym to pay for your app, and then the Gym Member paying for the Gym access. You have to have some way of connecting payments from Gym Member to the Gym and I think it would get confusing if you made it all roles in the AccountUser model.
Joe Tebaldi
Got it. I think I confused the admin role for the account with the admin flag on the user account.

So last thing, would I then create new a model and associated actions for GymInvitations if I wanted gym owners to be able to invite members? 
Chris Oliver
Yeah, you could duplicate that functionality for the gym owners to invite members. 👍
Joe Tebaldi
Chris Oliver Just a quick follow up - I created a new model for GymMember. I'm not launching with the ability for gym's to have paid plans, but I would love to add it as the first big feature after launch. 

Question: Would I be able to leverage the current Plan, PaySubscription and associated paid plan models or should I build separate models for those as well?

(PS I should be launching this week! Thanks for all of your help - Jumpstart has been great!)
Chris Oliver
I would build them separately, that way you're keeping things organized so that you have separate plans for what the gyms pay and separate plans for what the gyms charge members in the future. That'll make it easier for you to manage down the line when you need to introduce changes or whatever.
Notifications
You’re not receiving notifications from this thread.