Fix stage.team method not returning teams for playoff stages
This commit is contained in:
parent
babc233412
commit
6a2c71bad7
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue