You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What's the best way to deal with the user profile storage issue. There's possibility a lot of information to store on users, hopefully it can be set up to be indexed and quickly accessed and processed when needed. Non SQL solutions are of course welcome.
The text was updated successfully, but these errors were encountered:
You're using Devise so you have two options. You can store everything in a profile table that's associated with users table. This is the cleaner approach. current_user.profile.name gives you the user's name. However, that's adding a useless abstraction. I prefer to include profile info in the user table, then current_user.name is all that's needed.
When you get to where you have for example, posts which have comments which have votes and you want to know who voted, having one less abstraction is nice IMO.
I've read a lot about this and the community seems pretty evenly divided. For anything with multiples you use a separate table. So avatar being a single image would go into user, photos would get their own table.
I think your point is valid and makes total sense, though some user information isn't 'singular' and having it in a different location/table makes more sense for future functionality (i.e. matching up people with similar skills...for instance, find all the users in time zone a who are available during A or B and want to learn x from a beginner level).
I tend to overthink future functionality on things which is why things stall (and I tend to need some help it seems)
Well yes, I said anything with multiples goes in a separate table. I was simply stating my take on the pros and cons of also having an additional table for profile data.
What's the best way to deal with the user profile storage issue. There's possibility a lot of information to store on users, hopefully it can be set up to be indexed and quickly accessed and processed when needed. Non SQL solutions are of course welcome.
The text was updated successfully, but these errors were encountered: