I have a user model which has a users table associated with it.
I need to create a relational database around the user table like a user
can have many credit cards, a user can have many schemes, a user can
know many languages so on and so forth. I have some 7 to 10 association
between the user and different models.
How should I go about it?
- Should I create a user table, a credit_card table and a
users_credit_cards table and have them in a has_many through
relationship. This way I would be creating a reference table for each of
the association that is required. I would end up referencing some 15
tables to render a single form.
- Should I have them in a polymorphic association where I have a
user_details table which has a detail_type which can contain the class
name of either language,credit card etc.
Or do you think that there is a better way to do this task.
Any help in this would be highly appreciated.
Thanks in advance:)