Add matches method to tournament
The method collects all matches from all stages
This commit is contained in:
parent
eb2ddb3ce0
commit
77c76b7a31
|
|
@ -16,6 +16,10 @@ class Tournament < ApplicationRecord
|
|||
|
||||
after_initialize :generate_code
|
||||
|
||||
def matches
|
||||
stages.map(&:matches).flatten
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def generate_code
|
||||
|
|
|
|||
Loading…
Reference in New Issue