This repository was archived by the owner on Aug 22, 2025. It is now read-only.
411-missing-user-graph #473
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Story
override
Hyrax::Statistics::Users::OverTime#point
so the dashboard user graph does not breakthe version of this method in "hyrax-v3-5-0" returns a hash that the Morris.Bar graph cannot map. this override returns an integer instead. which I believe was the initial intent.
Expected Behavior Before Changes
adding a new user would break the user graph on the admin dashboard. this is because there would now be a user to plot, but the users being returned as data had hashes instead of integers. this messed up the entire graph and it could not be presented.
I added 2 users today and the result can be seen below as the value of
relation.where(query).count
. the hash contains the user_id as the key, and the number 1 as the value. presumably because there is one user with that id.example of user hash
Expected Behavior After Changes
we are now returning an integer as the user count, instead of a hash. (calling
.size
on the relation also returned a hash) this required converting theUser::ActiveRelation
into an array. we are also using.size
instead of.count
for performance reasons.Screenshots / Video