ActiveRecord Associations Question
Posted
by Mutuelinvestor
on Stack Overflow
See other posts from Stack Overflow
or by Mutuelinvestor
Published on 2010-03-13T17:40:38Z
Indexed on
2010/03/13
18:25 UTC
Read the original article
Hit count: 517
I'm new to rails and have volunteered to help out the local High School Track team with a simple database that tracks the runners performances. For the moment, I have three models: Runners, Race_Data and Races. I have the following associations.
Runners have_many Race_Data
Races have_many Race_Data
I also want create the association Runners Have_Many Races Through Race_Data, but as my look at the diagram I have drawn, there is already a many to one relationship from Race_data to Races. Does the combination of Runners having many Race_Data and Race_Data having one Race imply a Many_to_Many relationship between Runners and Races?
© Stack Overflow or respective owner