From 33ccab8988c2067fe3f32e224f675c23d5848cfb Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Sat, 26 Oct 2019 00:32:14 +0200 Subject: [PATCH] Return all matches also from groups --- app/models/tournament.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/tournament.rb b/app/models/tournament.rb index 6a52b62..d91ec72 100644 --- a/app/models/tournament.rb +++ b/app/models/tournament.rb @@ -17,7 +17,7 @@ class Tournament < ApplicationRecord after_initialize :generate_code def matches - stages.map(&:matches).flatten + [stages.map(&:matches), stages.map { |s| s.groups.map(&:matches) }].flatten end private