summaryrefslogtreecommitdiff
path: root/app/models/bracket.rb
blob: acd33ca038327745bc9221dfe24b0bd4911f7362 (plain)
1
2
3
4
5
6
7
8
9
10
11
class Bracket < ActiveRecord::Base
	belongs_to :user
	belongs_to :tournament
	has_many :bracket_matches

	def create_matches
		tournament.stages.first.matches.each do |m|
			bracket_matches.create(match: m)
		end
	end
end