I'm wracking my brain about how to start setting up the following set of model relationships in my project. I'm not looking for the complete solution (models, tables, migrations, etc), just a little help to get me going in the right direction. I learn more by struggling on my own :)
In short, I want my Users
(created with Devise) to have a set of Inclinations
that represent preferences they have to certain things (i.e. warmer weather vs colder weather, watching sports vs playing sports, etc) on a sliding scale (coded 5 to -5, zero excluded). Each Inclination
(or InclinationData
?) will be in a separate table with a name, description, etc, and all Inclinations
will get their data pulled from that table (so I don't repeat myself throughout my application). Also, every User
will have one Inclination
record for each InclinationData(?)
by default.
As for the setup, will I need:
- 5 tables (3 main ones and two join tables)?
- Just three (main three models)?
- Four (main three models & a joining table for
Inclinations
andInclinationData
)? - Four (main three models & a joining table for
Users
&Inclinations
)? - Perhaps something simpler like a single
Profile
orPreferences
model that's bound to aUser
?
I can never figure out how to decide if joining tables are necessary, and this is the most complex association I've ever tried.
I appreciate any help, and please let me know if you need more information to be able to help me out.