summaryrefslogtreecommitdiff
path: root/lib/scheduling/round_robin.rb
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-28 01:30:48 -0400
committertkimia <tkimia@purdue.edu>2014-04-28 01:30:48 -0400
commit85c74dac1f82dc1869a2875a9354be0b4b3361ac (patch)
tree4154815d3e5896ee6d68712f08a4dcac2b84872b /lib/scheduling/round_robin.rb
parentb0b2a235f02b95058aa7bfbf817d5dd1d85b6730 (diff)
parent9a8d183f6896a92b84a15599323b32e73b5868b9 (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'lib/scheduling/round_robin.rb')
-rw-r--r--lib/scheduling/round_robin.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/scheduling/round_robin.rb b/lib/scheduling/round_robin.rb
index 0cbddc1..f2e4144 100644
--- a/lib/scheduling/round_robin.rb
+++ b/lib/scheduling/round_robin.rb
@@ -9,7 +9,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
# => initialize data and status members
@team_pairs ||= {}
@@ -18,13 +18,13 @@ module Scheduling
end
# => Create new matches
- @matches_per_round.each do |match|
+ @matches_per_round.times do
tournament_stage.matches.create(status: 0, submitted_peer_evaluations: 0)
end
# => seed the first time
if @team_pairs.empty?
- tournament_stage.seeding.seed_matches(tournament_stage)
+ tournament_stage.seeding.seed(tournament_stage)
tournament_stage.matches.each {|match| match.teams.each {|team| @team_pairs += team}}
else
# => Reorder the list of teams