Topic: ActiveRecord Relationship Question
I'm re-writing a hockeypool website currently written in php into RoR. Forgive me, as I am a newbie and this is my first RoR application.
I have two tables that I would like to model a relationship through using ActiveRecord. The tables are "Franchises" and "Goalies".
There will only be 10 records in the Franchises table. Each franchise will have two or more goalies.
However, in the Goalies table, there will be approximately 25 goalies. What is confusing me is the fact that each goalie will have a separate record based on each week of the season, and the season is approx. 26 weeks long. As well, a given goalie can change franchises, so Goalie#1 may belong to Franchise1 for the first 12 weeks, but belong to Franchise2 for the remaining 14 weeks.
How would this relationship be modelled? So far, I thought it would be as follows:
class Franchise < ActiveRecord::Base
class Goalie < ActiveRecord::Base
Does anyone see any issue with this? Is this correct or is there a better way to do it?
Thanks for your help.