title: Ruby on Rails: how to writer seed data for a table with two (multiple) foreign keys
body: <p>I have four tables:</p>
  
  <pre><code>Honors (student_id,course_id,prof_id)#referencing 3 tables
  student(student_id, name,phnumber,)
  course(course_id, cousename)
  Prof_id(prof_id,prfEmail)
  </code></pre>
  
  <p>In honor.db</p>
  
  <pre><code>class Honor &lt; ActiveRecord::Base
        belongs_to :course
        belongs_to :student
        belongs_to :professor
  end
  </code></pre>
  
  <p>In course.db</p>
  
  <pre><code>class Course &lt; ActiveRecord::Base
      has_many :honors
  end
  </code></pre>
  
  <p>Similarly with student.rb, professor.rb</p>
  
  <p>can you please help me with writing the seed data for this tables.</p>
  
  <p>For writing single foreign key reference I know how to write. but i am not sure how to do it for 3 foreign references on a single table.</p>
  
  <p>Example for single foreign key(a person has many reviews) :</p>
  
  <pre><code>Person.create(first_name: 'Nicol',last_name: 'Cagase',dob: Date.new(1964,1,7),
  
              reviews: Review.create([
                  {stars: 4 , title: 'The Game of Thrones', commentary: 'waiting for next episode'},
                  {stars: 3 , title: 'KingsMan', commentary: 'average'},
      ]))
  </code></pre>