fixup evaluate_winner method match

This commit is contained in:
Daniel Schädler 2019-05-13 09:31:35 +02:00
parent 74282ea372
commit 5df8714124
1 changed files with 1 additions and 0 deletions

View File

@ -31,6 +31,7 @@ class Match < ApplicationRecord
private private
def evaluate_winner def evaluate_winner
return nil unless finished?
return nil if match_scores.first.points == match_scores.second.points return nil if match_scores.first.points == match_scores.second.points
match_scores.max_by(&:points).team match_scores.max_by(&:points).team