From 41bb23ae1d61f1e94749a288d822c93b430ee9c8 Mon Sep 17 00:00:00 2001 From: Tiago Botelho Date: Tue, 13 Feb 2018 15:42:49 +0000 Subject: Restore memoization to base query and add a batch base query method --- app/serializers/analytics_stage_entity.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/serializers') diff --git a/app/serializers/analytics_stage_entity.rb b/app/serializers/analytics_stage_entity.rb index 08fa8b83c24..f87eb78e0e8 100644 --- a/app/serializers/analytics_stage_entity.rb +++ b/app/serializers/analytics_stage_entity.rb @@ -7,6 +7,6 @@ class AnalyticsStageEntity < Grape::Entity expose :description expose :median, as: :value do |stage| - stage.median && !stage.median.blank? ? distance_of_time_in_words(stage.median) : nil + distance_of_time_in_words(stage.median) if stage.median && !(stage.median.blank? || stage.median.zero?) end end -- cgit v1.2.1