Justin Meltzer
Justin Meltzer

Reputation: 13548

Profile model association question

Is it a good idea to make a profile its own model with a has_one/belongs_to association with the User model, or should the attributes of a profile just be columns in the user database?

Upvotes: 1

Views: 105

Answers (1)

dbers
dbers

Reputation: 654

This is really a design decision that needs to be decided by how its going to be used.

I've recently created a program that has a 'user' and 'profile' model separated with the 'user' always having the a 'profile' constraint.

I did it this way since there is nothing in the 'user' table other then information needed to login a user or allow the admin to see/do certain things.

Whereas the 'profile' model contains data that can be viewed and searched on by other members.

But again, its a design decision you have to make based on how the data will be used.

Upvotes: 3

Related Questions