turniere-backend/app/serializers/live_match_serializer.rb

17 lines
269 B
Ruby

# frozen_string_literal: true
class LiveMatchSerializer < ApplicationSerializer
attributes :position, :state, :teams
has_many :match_scores
def teams
object.teams.map do |team|
{
id: team.id,
name: team.name
}
end
end
end