From 2de1581f4deb21857e81e7e0d6267c0dff3ea087 Mon Sep 17 00:00:00 2001 From: vonavi Date: Tue, 25 Mar 2014 15:15:47 +0200 Subject: [PATCH] Tournament table: allow tours with no game. --- lib/lorchess/round_robin_table.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/lorchess/round_robin_table.rb b/lib/lorchess/round_robin_table.rb index 34ae4eb..c5d1dbe 100644 --- a/lib/lorchess/round_robin_table.rb +++ b/lib/lorchess/round_robin_table.rb @@ -54,11 +54,13 @@ module LORChess def fill_results @@db_results.each do |tour| - # zero-based round - round = (tour['number'] - 1).div(@@dim - 1) + if tour['games'] + # zero-based round + round = (tour['number'] - 1).div(@@dim - 1) - tour['games'].each do |game| - import game, round + tour['games'].each do |game| + import game, round + end end end end