ActiveRecord many_to_many association confusion
<p>I am creating a quiz in Rails and I am drawing a blank on my associations.</p>

<p>I say I have three tables that I know are going to be there.</p>

<pre><code>users
   |___id
   |___name

quizzes
   |___id
   |___user_id

questions
   |___id
   |___question
   |___poss_answer_one
   |___poss_answer_two
   |___poss_answer_three
   |___answer
   |___test_version
</code></pre>

<p>This is what I started with. The functionality of the site is as follows:</p>

<p>A user can select questions from up to three categories to add to their active quiz (quizzes). So a user will only have one quiz at a time because when they finish or restart a new one, the entry into the quizzes table will be re-created.</p>

<p>So the user has_one quiz and quizzes belongs_to users.</p>

<p>Next I am assuming that a quiz has_many questions and because questions are re-usable and can be included in many different quizzes, would it require a join table?</p>

<p>If so would it be </p>

<pre><code>quiz_questions
   |___id
   |___question_id
   |___quiz_id
</code></pre>

<p>In that case it would require a has_many through.</p>

<p>Once I get this done I know how to model the associations, I am just confusing myself because of the wording.</p>