Skip to content

Commit

Permalink
update Hyrax::Statistics::Users::OverTime#point so user graph does no…
Browse files Browse the repository at this point in the history
…t 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: scientist-softserv/palni-palci#473
  • Loading branch information
alishaevn committed Jun 30, 2023
1 parent 53f2f0b commit d886ae8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/services/hyrax/statistics/users/over_time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d886ae8

Please sign in to comment.