Skip to content

Instantly share code, notes, and snippets.

@abloom
Created February 25, 2009 21:11
Show Gist options
  • Save abloom/70413 to your computer and use it in GitHub Desktop.
Save abloom/70413 to your computer and use it in GitHub Desktop.
class Player < ActiveRecord::Base
belongs_to :team
end
class Team < ActiveRecord::Base
has_many :leagues
has_many :players
end
class League < ActiveRecord::Base
belongs_to :team
has_many :players, :through => :team
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment