Designing models with Ruby On Rails
<p>I have the following models:</p>

<ul>
<li>Institute</li>
<li>Student</li>
<li>Classroom</li>
<li>Course</li>
</ul>

<p><strong>Requirements:</strong></p>

<ol>
<li>A classroom can have many courses. A course can belong to many classrooms.</li>
<li>A classroom can have many students. A student can belong to many classrooms.</li>
<li>A student can take many courses. A course can belong to many students.</li>
<li>An institute has many students, many classrooms and many courses.</li>
</ol>

<p>I'm trying to create associations for the above:
Would the following be accurate?</p>

<ol>
<li><strong>Institute:</strong> has_and_belongs_to_many :students | has_many :classrooms | has_many :courses</li>
<li><strong>Student:</strong> has_and_belongs_to_many :institutes | has_and_belongs_to_many :classrooms | has_many :courses | belongs_to :institute</li>
<li><strong>Classroom:</strong> has_and_belongs_to_many :students | has_many :courses | belongs_to :institute</li>
<li><strong>Course:</strong> has_and_belongs_to_many :students | has_many :classrooms | belongs_to :institute</li>
</ol>

<p>How do I use the "through" relationship here?</p>