1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-21 14:22:24 +00:00

Making progress on generating matches.

This commit is contained in:
2014-12-18 10:45:49 -05:00
parent 1899218798
commit 90b96bb218
5 changed files with 43 additions and 394 deletions

View File

@@ -4,10 +4,19 @@ class Tournament < ActiveRecord::Base
has_many :matches, dependent: :destroy
has_many :mats, dependent: :destroy
def bouts
@pool = Pool.new
@pool.createPool(self.id)
@bouts = Bout.all
return @bouts
def generateMatches
destroyAllMatches
self.weights.each do |weight|
puts weight.inspect
weight.generatePool
end
end
def destroyAllMatches
@matches_all = Match.where(tournament_id: self.id)
@matches_all.each do |match|
match.destroy
end
end
end