From f5f439f2c91f7508f32c136115b0f9bcd6186672 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Wed, 5 Sep 2018 13:35:23 +0100 Subject: Ensure services counts always have values in usage pings --- lib/gitlab/usage_data.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb index e5c7c260c97..957908f183d 100644 --- a/lib/gitlab/usage_data.rb +++ b/lib/gitlab/usage_data.rb @@ -121,7 +121,7 @@ module Gitlab } results = count(Service.unscoped.where(type: types.keys, active: true).group(:type), fallback: Hash.new(-1)) - results.each_with_object({}) { |(key, value), response| response[types[key.to_sym]] = value } + types.each_with_object({}) { |(klass, key), response| response[key] = results[klass.to_s] || 0 } end def count(relation, fallback: -1) -- cgit v1.2.1