Add serializer for Match, Score and Team

This commit is contained in:
Thor77 2018-11-21 18:57:59 +01:00
parent 6c24180715
commit bc88ddc54d
4 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,4 @@
# frozen_string_literal: true
class ApplicationSerializer < ActiveModel::Serializer
end

View File

@ -0,0 +1,7 @@
# frozen_string_literal: true
class MatchSerializer < ApplicationSerializer
attributes :state
has_many :scores
end

View File

@ -0,0 +1,7 @@
# frozen_string_literal: true
class ScoreSerializer < ApplicationSerializer
attributes :score
has_one :team
end

View File

@ -0,0 +1,5 @@
# frozen_string_literal: true
class TeamSerializer < ApplicationSerializer
attributes :name
end