From b2bd85de2d7ca642dcef62aa0ef1eee078be7938 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Mon, 28 Apr 2014 14:16:47 -0400 Subject: Matches now move forward after being created from RR. --- lib/scheduling/round_robin.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3