Sha256: 5d2f95d4b8797f7602180d7ff5aa97072aea9744c2e6df2281729f0725e32192
Contents?: true
Size: 306 Bytes
Versions: 20
Compression:
Stored size: 306 Bytes
Contents
module Sufia::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 end
Version data entries
20 entries across 20 versions & 2 rubygems