Improve Formatting in playoff_stage_service (I guess)

... Rubocop wanted it that way
This commit is contained in:
Daniel Schädler 2019-05-11 17:30:41 +02:00
parent 93096350f0
commit e5cb2b00b5
1 changed files with 7 additions and 7 deletions

View File

@ -74,13 +74,13 @@ class PlayoffStageService
def self.populate_match_with_winners(match, first_match, second_match)
match_scores = match.match_scores.sort_by(&:id)
matches = [first_match, second_match].sort_by(&:position)
winners = []
if second_match.finished?
winners = matches.map(&:winner)
else
winners = matches.map{ |m|
m == first_match ? m.winner : nil }
end
winners = if second_match.finished?
matches.map(&:winner)
else
matches.map do |m|
m == first_match ? m.winner : nil
end
end
# depending on the amount of match_scores already present we need to do different things
case match_scores.size