Add winner attribute to match serializer
This commit is contained in:
parent
4e0da7f8ab
commit
91fe9dba16
|
|
@ -1,7 +1,11 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class MatchSerializer < ApplicationSerializer
|
class MatchSerializer < ApplicationSerializer
|
||||||
attributes :state, :position
|
attributes :state, :position, :winner
|
||||||
|
|
||||||
|
def winner
|
||||||
|
ActiveModelSerializers::SerializableResource.new(object.winner).as_json
|
||||||
|
end
|
||||||
|
|
||||||
has_many :match_scores
|
has_many :match_scores
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue