Sha256: ac61904c3b491640c78ac7a63dfaa6957dc92e9091e819f6fe8177bf9e8b3a8c

Contents?: true

Size: 475 Bytes

Versions: 4

Compression:

Stored size: 475 Bytes

Contents

class FileDownloadStat < Sufia::Statistic
  self.cache_column = :downloads
  self.event_type = :totalEvents

  # Sufia::Download is sent to Sufia::Analytics.profile as #sufia__download
  # see Legato::ProfileMethods.method_name_from_klass
  def self.ga_statistics(start_date, file)
    Sufia::Analytics.profile.sufia__download(sort: 'date', start_date: start_date, end_date: Date.yesterday).for_file(file.id)
  end

  def self.filter(file)
    { file_id: file.id }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sufia-7.1.0 app/models/file_download_stat.rb
sufia-7.0.0 app/models/file_download_stat.rb
sufia-7.0.0.rc2 app/models/file_download_stat.rb
sufia-7.0.0.rc1 app/models/file_download_stat.rb