mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-18 13:37:55 +00:00
Reset team scores when generating matches
This commit is contained in:
@@ -6,6 +6,7 @@ module GeneratesTournamentMatches
|
|||||||
end
|
end
|
||||||
|
|
||||||
def poolToBracket
|
def poolToBracket
|
||||||
|
resetSchoolScores
|
||||||
destroyAllMatches
|
destroyAllMatches
|
||||||
buildTournamentWeights
|
buildTournamentWeights
|
||||||
generateMatches
|
generateMatches
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ class Tournament < ActiveRecord::Base
|
|||||||
has_many :wrestlers, through: :weights
|
has_many :wrestlers, through: :weights
|
||||||
has_many :matches, dependent: :destroy
|
has_many :matches, dependent: :destroy
|
||||||
|
|
||||||
|
def resetSchoolScores
|
||||||
|
schools.update_all("score = 0.0")
|
||||||
|
end
|
||||||
|
|
||||||
def tournament_types
|
def tournament_types
|
||||||
["Pool to bracket"]
|
["Pool to bracket"]
|
||||||
|
|||||||
Reference in New Issue
Block a user