diff --git a/app/models/match.rb b/app/models/match.rb index 0c5e676..df8e8b7 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -31,6 +31,7 @@ class Match < ApplicationRecord private def evaluate_winner + return nil unless finished? return nil if match_scores.first.points == match_scores.second.points match_scores.max_by(&:points).team