Ruby on Rails Saturday, April 30, 2016

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

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


Posted via

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment