-
-
Save matschaffer/96806 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class District | |
has_many :leagues | |
has_many :seasons, :through => :leagues | |
# If this doesn't work | |
has_many :teams, :through => :seasons | |
# How about this? | |
def teams | |
seasons.teams | |
end | |
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