Improve Formatting in playoff_stage_service (I guess)
... Rubocop wanted it that way
This commit is contained in:
parent
93096350f0
commit
e5cb2b00b5
|
|
@ -74,12 +74,12 @@ class PlayoffStageService
|
||||||
def self.populate_match_with_winners(match, first_match, second_match)
|
def self.populate_match_with_winners(match, first_match, second_match)
|
||||||
match_scores = match.match_scores.sort_by(&:id)
|
match_scores = match.match_scores.sort_by(&:id)
|
||||||
matches = [first_match, second_match].sort_by(&:position)
|
matches = [first_match, second_match].sort_by(&:position)
|
||||||
winners = []
|
winners = if second_match.finished?
|
||||||
if second_match.finished?
|
matches.map(&:winner)
|
||||||
winners = matches.map(&:winner)
|
|
||||||
else
|
else
|
||||||
winners = matches.map{ |m|
|
matches.map do |m|
|
||||||
m == first_match ? m.winner : nil }
|
m == first_match ? m.winner : nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# depending on the amount of match_scores already present we need to do different things
|
# depending on the amount of match_scores already present we need to do different things
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue