1 2 3 4 5 6 7 8
class Match < ActiveRecord::Base belongs_to :tournament has_and_belongs_to_many :teams belongs_to :winner, class_name: "Team" end