Fix stage.team method not returning teams for playoff stages

This commit is contained in:
Daniel Schädler 2019-05-02 11:12:57 +02:00
parent babc233412
commit 6a2c71bad7
1 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,8 @@ class Stage < ApplicationRecord
has_many :groups, dependent: :destroy has_many :groups, dependent: :destroy
def teams def teams
groups.map(&:teams).flatten.uniq return matches.map(&:teams).flatten.uniq unless matches.size.zero?
groups.map(&:teams).flatten.uniq unless groups.size.zero?
end end
end end