From 36db03293e62cfe12d81489f625d1c3c9870ab04 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Wed, 12 Jun 2019 20:39:09 +0200 Subject: [PATCH] Return a "winner" for :single_team matches --- app/models/match.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/match.rb b/app/models/match.rb index 7891276..6e15b10 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -28,6 +28,8 @@ class Match < ApplicationRecord end def winner + return teams.first if single_team? + finished? ? current_leading_team : nil end