Add tournament serializers

SimpleTournamentSerializer excludes relationships and should be used for
listings
This commit is contained in:
Thor77 2018-11-25 20:03:07 +01:00
parent fecdb7db2d
commit d1f66b18d4
No known key found for this signature in database
GPG Key ID: 5051E71B46AA669A
2 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# frozen_string_literal: true
class SimpleTournamentSerializer < ApplicationSerializer
attributes :name, :code, :description, :public
end

View File

@ -0,0 +1,6 @@
# frozen_string_literal: true
class TournamentSerializer < SimpleTournamentSerializer
has_many :teams
has_many :stages
end