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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user