How do I setup this odd join?

What I am trying to do is the following:

I have a Student table with some fields...

I need to join the student in two different ways...

1. The student has a home district 2. The student can be in one or more reporting districts

I understand the join table for the reporting districts, however is it also possible to have a district_id in the student table as well which is his/her home district?

Or do I have to do a has many through?

I would like to be able to do

  student.district as well as student.reporting_districts or something similar.

  Sorry... Really new to rails and still trying to learn the proper syntax...

John

You could add a district_id field to the students table and set it up as a belongs_to relationship.

Or, you already have a has_many through table to connect students and districts (your reporting districts), correct? You could add a field in that table to indicate the primary district.

If a student will only ever have one primary district, I would generally prefer the first way.

Jim Crate