Skip to content

Instantly share code, notes, and snippets.

@nodabs
Created April 16, 2009 22:55
Show Gist options
  • Save nodabs/96736 to your computer and use it in GitHub Desktop.
Save nodabs/96736 to your computer and use it in GitHub Desktop.
class District
has_many :leagues
has_many :seasons, :through => :leagues
# has_many :teams ???
end
class League
belongs_to :district
has_many :seasons
has_many :teams, :through => :seasons
end
class Season
belongs_to :league
has_many :teams
end
class Team
belongs_to :season
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment