Implement method to check which is leading
This commit is contained in:
parent
810d541791
commit
26267deba0
|
|
@ -19,13 +19,18 @@ class Match < ApplicationRecord
|
|||
stage ? stage.owner : group.owner
|
||||
end
|
||||
|
||||
def winner
|
||||
return nil unless finished?
|
||||
def current_leading_team
|
||||
return nil if match_scores.first.points == match_scores.second.points
|
||||
|
||||
match_scores.max_by(&:points).team
|
||||
end
|
||||
|
||||
def winner
|
||||
return nil unless finished?
|
||||
|
||||
current_leading_team
|
||||
end
|
||||
|
||||
def group_match?
|
||||
group.present?
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue