Merge pull request #47 from turniere/ticket/TURNIERE-225
Add winner attribute to match serializer
This commit is contained in:
commit
08eabcd0f9
|
|
@ -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