Merge pull request #47 from turniere/ticket/TURNIERE-225

Add winner attribute to match serializer
This commit is contained in:
Thor77 2019-05-28 23:32:11 +02:00 committed by GitHub
commit 08eabcd0f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,11 @@
# frozen_string_literal: true
class MatchSerializer < ApplicationSerializer
attributes :state, :position
attributes :state, :position, :winner
def winner
ActiveModelSerializers::SerializableResource.new(object.winner).as_json
end
has_many :match_scores
end