summaryrefslogtreecommitdiff
path: root/app/models/bracket.rb
blob: 7e22f0d5e43e15e6def1b92a49b2d91c03d3a1af (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_ordered.each do |m|
			bracket_matches.create(match: m)
		end
	end
end