Sha256: 0445fd98c530099ed1906b1f80c9e8f97707972f3b4a7dac46b43307694c3e6c
Contents?: true
Size: 426 Bytes
Versions: 29
Compression:
Stored size: 426 Bytes
Contents
# frozen_string_literal: true module Hyrax::UserUsageStats def stats @stats ||= UserStat.where(user_id: id).order(date: :asc) end def total_file_views stats.reduce(0) { |total, stat| total + stat.file_views } end def total_file_downloads stats.reduce(0) { |total, stat| total + stat.file_downloads } end def total_work_views stats.reduce(0) { |total, stat| total + stat.work_views } end end
Version data entries
29 entries across 29 versions & 1 rubygems