From d886ae8622f65a1957412e5a1466174dd6b62e73 Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Fri, 30 Jun 2023 13:13:21 -0500 Subject: [PATCH] update Hyrax::Statistics::Users::OverTime#point so user graph does not break. (#6092) the previous version of this method returned a hash that the Morris.Bar graph cannot map. this change returns an integer instead. which I believe was the initial intent. contributing from: https://github.com/scientist-softserv/palni-palci/pull/473 --- app/services/hyrax/statistics/users/over_time.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/services/hyrax/statistics/users/over_time.rb b/app/services/hyrax/statistics/users/over_time.rb index d15771a23d..8f38faea4b 100644 --- a/app/services/hyrax/statistics/users/over_time.rb +++ b/app/services/hyrax/statistics/users/over_time.rb @@ -26,7 +26,9 @@ def query(date_string) end def point(date_string) - relation.where(query(date_string)).count + # convert the User::ActiveRecord_Relation to an array so that ".size" returns a number, + # instead of a hash of { user_id: size } + relation.where(query(date_string)).to_a.size end end end