Sha256: efad0e9540c45144eb7e24a00fdd57d27f6108e08c76dfd88fe64a2c8eb0663b

Contents?: true

Size: 595 Bytes

Versions: 10

Compression:

Stored size: 595 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, user_id = nil)
    combined_stats file_id, start_date, :downloads, :totalEvents, user_id
  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

10 entries across 10 versions & 2 rubygems

Version Path
sufia-models-6.7.0 app/models/file_download_stat.rb
sufia-7.0.0.beta4 app/models/file_download_stat.rb
sufia-7.0.0.beta3 app/models/file_download_stat.rb
sufia-7.0.0.beta2 app/models/file_download_stat.rb
sufia-7.0.0.beta1 app/models/file_download_stat.rb
sufia-models-6.6.1 app/models/file_download_stat.rb
sufia-models-6.6.0 app/models/file_download_stat.rb
sufia-models-6.5.0 app/models/file_download_stat.rb
sufia-models-6.4.0 app/models/file_download_stat.rb
sufia-models-6.3.0 app/models/file_download_stat.rb