summaryrefslogtreecommitdiff
path: root/app/serializers
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-02-15 13:23:39 +0000
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-02-28 10:46:20 +0000
commit335ee79a73fafdf00fac6e8ffc286ce4bad273ff (patch)
treed30033fd007c992448ce02f42e46f9da48e223cb /app/serializers
parent3f31da9c69c550d1698a1376e37d36f4e6e309b5 (diff)
downloadgitlab-ce-335ee79a73fafdf00fac6e8ffc286ce4bad273ff.tar.gz
Refactors median code to work with both single and multiple projects
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/analytics_stage_entity.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/serializers/analytics_stage_entity.rb b/app/serializers/analytics_stage_entity.rb
index f87eb78e0e8..a9e331559b1 100644
--- a/app/serializers/analytics_stage_entity.rb
+++ b/app/serializers/analytics_stage_entity.rb
@@ -7,6 +7,8 @@ class AnalyticsStageEntity < Grape::Entity
expose :description
expose :median, as: :value do |stage|
- distance_of_time_in_words(stage.median) if stage.median && !(stage.median.blank? || stage.median.zero?)
+ if stage.median && !(stage.median.nil? || stage.median.zero?)
+ distance_of_time_in_words(stage.median)
+ end
end
end