From e8465df700a669ab78160f904a1ccf333444983f Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Fri, 10 May 2019 12:01:34 +0200 Subject: [PATCH] Add winner method to match --- app/models/match.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/match.rb b/app/models/match.rb index 8d96f47..6914310 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -19,6 +19,11 @@ class Match < ApplicationRecord stage ? stage.owner : group.owner end + def winner + evaluate_winner + # This should maybe be cached or put into db + end + private def evaluate_winner