Sha256: ff3c57e4d1f9a7410bdcd70096cbe3bf52f650ad8437396b2f93ba68bb711ef2

Contents?: true

Size: 572 Bytes

Versions: 3

Compression:

Stored size: 572 Bytes

Contents

class FileDownloadStat < ActiveRecord::Base
  extend Sufia::FileStatUtils

  def to_flot
    [ self.class.convert_date(date), downloads ]
  end

  def self.statistics file_id, start_date
    combined_stats file_id, start_date, :downloads, :totalEvents
  end

  # 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_id
    Sufia::Analytics.profile.sufia__download(sort: 'date', start_date: start_date, end_date: Date.yesterday).for_file(file_id)
  end

end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
sufia-models-5.0.0.beta1 app/models/file_download_stat.rb
sufia-4.2.0 sufia-models/app/models/file_download_stat.rb
sufia-models-4.2.0 app/models/file_download_stat.rb