Include parent group/stage in .index
This commit is contained in:
parent
b4418ffd5a
commit
28d047b1bf
|
|
@ -15,7 +15,9 @@ class MatchesController < ApplicationController
|
|||
m.state == match_params['state']
|
||||
end
|
||||
end
|
||||
render json: matches, each_serializer: MatchSerializer, include: '**'
|
||||
render json: matches, each_serializer: ExtendedMatchSerializer, include: [
|
||||
'match_scores.team', 'bets', 'stage', 'group'
|
||||
]
|
||||
end
|
||||
|
||||
# GET /matches/1
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ExtendedMatchSerializer < MatchSerializer
|
||||
belongs_to :group
|
||||
belongs_to :stage
|
||||
end
|
||||
Loading…
Reference in New Issue