Reputation: 599
I have a User model generated with Devise.
Now I want every user to have other columns
- balance
- paperclip logo
- website
- address
- phone
etc
What is the best way to organize such data?
Should I make separate tables (like Phones table, Address table, Userlogo table etc) and establish One-To-One relationship?
I've heard that putting everything to one table is bad.
Would be nice to hear some opinions.
Upvotes: 1
Views: 113
Reputation: 2091
Putting everything to one table:
Separating attributes:
I think you choice depends a lot on what your application does, so if you always need all info about user, then put everything in one table other wise you could separate data.
Anyway, you could do both so you could have the user
model and another model named user_data
, and that model will hold all the extra information such as phone
, address
, etc ... this way you get the benefits from both approaches.
Upvotes: 1