Skip to content

Commit

Permalink
Explicitly cast metrics from Matomo to be integers (#6853)
Browse files Browse the repository at this point in the history
see: matomo-org/matomo#21978

Co-authored-by: Ryan Baumann <[email protected]>
  • Loading branch information
dlpierce and ryanfb authored Aug 5, 2024
1 parent 4273c06 commit 4b74958
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/services/hyrax/analytics/matomo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ def results_array(response, metric)
if result[1].empty?
results.push([result[0].to_date, 0])
elsif result[1].is_a?(Array)
results.push([result[0].to_date, result[1].first[metric]])
results.push([result[0].to_date, result[1].first[metric].to_i])
else
results.push([result[0].to_date, result[1][metric].presence || 0])
results.push([result[0].to_date, result[1][metric].presence.to_i])
end
end
Hyrax::Analytics::Results.new(results)
Expand Down

0 comments on commit 4b74958

Please sign in to comment.