Add serializer for Match, Score and Team
This commit is contained in:
parent
6c24180715
commit
bc88ddc54d
|
|
@ -0,0 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class ApplicationSerializer < ActiveModel::Serializer
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class MatchSerializer < ApplicationSerializer
|
||||||
|
attributes :state
|
||||||
|
|
||||||
|
has_many :scores
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class ScoreSerializer < ApplicationSerializer
|
||||||
|
attributes :score
|
||||||
|
|
||||||
|
has_one :team
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class TeamSerializer < ApplicationSerializer
|
||||||
|
attributes :name
|
||||||
|
end
|
||||||
Loading…
Reference in New Issue