Sha256: 82025b8f2e792f13592adda594d39b29100ce01a87b22198b8eb40d71fb82a58
Contents?: true
Size: 396 Bytes
Versions: 58
Compression:
Stored size: 396 Bytes
Contents
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
58 entries across 58 versions & 2 rubygems