summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-28 14:16:47 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-28 14:16:47 -0400
commitb2bd85de2d7ca642dcef62aa0ef1eee078be7938 (patch)
tree5b6d8655254506a9f9e27c26c069470b5f834063
parent9ec58dc23d77fa8cab90119af10c25d98d8da7df (diff)
Matches now move forward after being created from RR.
-rw-r--r--lib/scheduling/round_robin.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/scheduling/round_robin.rb b/lib/scheduling/round_robin.rb
index 6185864..c0d68d3 100644
--- a/lib/scheduling/round_robin.rb
+++ b/lib/scheduling/round_robin.rb
@@ -10,7 +10,7 @@ module Scheduling
def create_matches
# => find the number of matches and teams to create
@num_teams = (tournament.players.count/tournament.min_players_per_team).floor
- @matches_per_round = @num_teams * tournament.min_teams_per_match
+ @matches_per_round = (@num_teams / tournament.min_teams_per_match).floor
# => initialize data and status members
@team_pairs ||= Array.new
@@ -45,6 +45,10 @@ module Scheduling
end
end
+
+ # => Set the match statuses to ready (1)
+ tournament_stage.matches.each {|match| match.update(status: 1)}
+
end
def finish_match(match)