ozfortress/citadel

View on GitHub
app/serializers/api/v1/leagues/match_serializer.rb

Summary

Maintainability
A
0 mins
Test Coverage
module API
  module V1
    module Leagues
      class MatchSerializer < ActiveModel::Serializer
        type :match

        attributes :id, :forfeit_by, :status, :round_name, :round_number, :notice
        attributes :created_at

        belongs_to :league
        has_one :home_team, serializer: RosterSerializer
        has_one :away_team, serializer: RosterSerializer
        has_many :rounds, serializer: Matches::RoundSerializer
      end
    end
  end
end