From 4eef8a6be1374f65f688bf003e926e90e9b36efb Mon Sep 17 00:00:00 2001 From: Caio <117518+caiosba@users.noreply.github.com> Date: Thu, 7 Nov 2024 17:51:23 -0300 Subject: [PATCH] Data dashboard top tags: Return maximum 5. Reference: CV2-4111. --- lib/team_statistics.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/team_statistics.rb b/lib/team_statistics.rb index a4666322b..818c130a8 100644 --- a/lib/team_statistics.rb +++ b/lib/team_statistics.rb @@ -208,7 +208,7 @@ def top_media_tags end data = [] tags.each { |tag, value| data << { id: tag, label: tag, value: value } } - data.sort_by{ |object| object[:value] }.reverse + data.sort_by{ |object| object[:value] }.reverse.first(5) end # For both articles and tiplines