diff options
author | Małgorzata Ksionek <meksionek@gmail.com> | 2019-05-23 13:23:38 +0200 |
---|---|---|
committer | Małgorzata Ksionek <meksionek@gmail.com> | 2019-05-23 13:23:38 +0200 |
commit | ee92acccb47c073992f46f9b8f9132a8ef9a92a6 (patch) | |
tree | 691dd4c08919dc16c984fb4155c17a9c49d6c1d0 /app/serializers | |
parent | ddb2949b1c1b0797bb982749b8af22faf9a0a421 (diff) | |
download | gitlab-ce-ee92acccb47c073992f46f9b8f9132a8ef9a92a6.tar.gz |
Add specs for median serializing
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/analytics_stage_entity.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/serializers/analytics_stage_entity.rb b/app/serializers/analytics_stage_entity.rb index ab3cf912695..64eba185a4e 100644 --- a/app/serializers/analytics_stage_entity.rb +++ b/app/serializers/analytics_stage_entity.rb @@ -10,6 +10,7 @@ class AnalyticsStageEntity < Grape::Entity expose :median, as: :value do |stage| # median returns a BatchLoader instance which we first have to unwrap by using to_f + # we use to_f to make sure results below 1 are presented to the end-user !stage.median.to_f.zero? ? distance_of_time_in_words(stage.median) : nil end end |