I’m building a sample app for practice and am having trouble determining the best way to organize my models and associations. So let’s just say I have 3 models:
- Schools
- Classes
- Students
I want:
- schools to have many classes
- classes to have many students
- classes to belong to a school
- students to be enrolled in many classes in many different schools
The associations are making me dizzy, I’m not sure which ones to use. Help would be greatly appreciated.
Renamed
classtocourse, as the class nameClassis already taken. A join class such asenrollmentswould handle your many to many course <=> student relationship.