I’m a RoR newbie, so I’d like to be sure I’m on the right track. I’m
coding an application where I have one table with students and another
table with first year seminars (fyss). The students have listed 4 fys
preferences in order.
Since the FYS seminars are listed in order and we are trying to give
student their first choices, I cannot use a 1 - n relationship between
table students and table fyss.
My design uses a models as join tables. It works as follows:
- I have a table students with an id and a name.
- I have a table fyss with an id and a course title.
- I have a table fyschoice1s with an id, a student_id, and a fys_id.
- I have a table fyschoice2s with an id, a student_id, and a fys_id.
- I have a table fyschoice3s with an id, a student_id, and a fys_id.
- I have a table fyschoice4s with an id, a student_id, and a fys_id.
The last four tables have a 1 - 1 relationship between, for example,
students and fsychoices1 and between fyss and fyschoices1.
Is this the best solution? I’d deeply appreciate any guidance.
Thanks in advance.