diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index cfa430b..71abf28 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -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 diff --git a/app/serializers/extended_match_serializer.rb b/app/serializers/extended_match_serializer.rb new file mode 100644 index 0000000..8d96336 --- /dev/null +++ b/app/serializers/extended_match_serializer.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +class ExtendedMatchSerializer < MatchSerializer + belongs_to :group + belongs_to :stage +end