First a quick intro, I’m Roneesh, new-ish to rails, I started last fall by taking the web dev course at The Starter League in Chicago, IL. I’ve been coding away ever since.
I’m working on an app with a friend right now that manages guest registration for work spaces. The idea is that the work space puts a computer on their secretaries desk that guests use to register, they then get handy e-mails like wifi info and the person they’re there to visit gets notified via sms and email.
We built the app, but want to re-do some core domain modeling.
So, currently, most users never log into the app (they’re visiting guests), they just go through a four-screen process that logs their reason for visit. However, we anticipate that each work space will have 1-3 users (secretary, office manager, etc) who want to log into the app and see things like guest analytics, change the text sent out in e-mails, print guest usage reports, etc.
What’s the best way to model this?
Right now when someone goes to the app, they sign up with their e-mail, and they in effect represent their organization. This doesn’t seem flexible to us, and it doesn’t allow multiple users to see the same data (like a visitor log) unless they share login information.
Should we have an organization model, and organization has_many users? Then when a new user signs up, they also create an organization as well? And then they can add users to their organization via an admin panel?
Another way I can think of it is that rather than organization table, all the data has a Postgres style column that is an array of admin user_id’s, that way all the guest visiting data can be seen by any user_id in that array. That seems really hacky and prone to trouble though. (But also kinda fun!)
I want to keep this short, so I’ll not explicate anymore, however let me know if something is not clear and I’ll explain further. if anyone wants to talk about this in person, feel free to call at 469-337-9220 or email at email@example.com
Any and all help/feedback appreciated! Thanks everyone!