Merge pull request #46 from turniere/ticket/TURNIERE-223

Fix group scores not serialized correctly
This commit is contained in:
Daniel Schädler 2019-05-28 23:08:29 +02:00 committed by GitHub
commit 4e0da7f8ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -9,9 +9,9 @@ class StatisticsController < ApplicationController
if group_stage if group_stage
service = StatisticsService.new group_stage service = StatisticsService.new group_stage
render json: { render json: {
most_dominant_score: service.most_dominant_score, most_dominant_score: ActiveModelSerializers::SerializableResource.new(service.most_dominant_score).as_json,
least_dominant_score: service.least_dominant_score, least_dominant_score: ActiveModelSerializers::SerializableResource.new(service.least_dominant_score).as_json,
group_scores: service.group_scores group_scores: ActiveModelSerializers::SerializableResource.new(service.group_scores).as_json
} }
else else
render json: {}, status: :not_implemented render json: {}, status: :not_implemented