Fix group score not serialized correctly

when returned from statistics endpoint
This commit is contained in:
Thor77 2019-05-28 22:24:03 +02:00
parent e281b1b23f
commit 12005b95fa
No known key found for this signature in database
GPG Key ID: 5051E71B46AA669A
1 changed files with 3 additions and 3 deletions

View File

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