From 7c84949fcbf4b6e2ef08b00a3672cc979560c7b4 Mon Sep 17 00:00:00 2001 From: Sergei Tsoganov Date: Wed, 7 Dec 2022 16:27:59 +0200 Subject: [PATCH] Fixed chart data serialization --- app/controllers/repp/v1/stats_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/repp/v1/stats_controller.rb b/app/controllers/repp/v1/stats_controller.rb index 86448e2376..052cdcbc45 100644 --- a/app/controllers/repp/v1/stats_controller.rb +++ b/app/controllers/repp/v1/stats_controller.rb @@ -111,7 +111,7 @@ def group(domains) def registrar_names @registrar_names ||= ::Registrar.where(test_registrar: false) .map { |r| { "#{r.id}": r.name }.with_indifferent_access } - .inject(:merge) + .reduce({}, :merge) end def serialize_distribution_result(result) @@ -122,7 +122,7 @@ def serialize_distribution_result(result) hash = { name: name, y: value } hash.merge!({ sliced: true, selected: true }) if current_user.registrar.name == name hash - end + end.compact end def serialize_growth_rate_result(result) @@ -131,7 +131,7 @@ def serialize_growth_rate_result(result) name = registrar_names[key] [name, value] - end + end.compact end end end