Sha256: f66a4ccf637786995d69dc2359453b5e5e5a52b121ee287b7d40264b828bb04f

Contents?: true

Size: 594 Bytes

Versions: 20

Compression:

Stored size: 594 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

20 entries across 20 versions & 2 rubygems

Version Path
sufia-models-6.2.0 app/models/file_download_stat.rb
sufia-models-6.1.0 app/models/file_download_stat.rb
sufia-5.0.0 sufia-models/app/models/file_download_stat.rb
sufia-models-5.0.0 app/models/file_download_stat.rb
sufia-models-6.0.0 app/models/file_download_stat.rb
sufia-6.0.0 sufia-models/app/models/file_download_stat.rb
sufia-6.0.0.rc4 sufia-models/app/models/file_download_stat.rb
sufia-models-6.0.0.rc4 app/models/file_download_stat.rb
sufia-6.0.0.rc3 sufia-models/app/models/file_download_stat.rb
sufia-models-6.0.0.rc3 app/models/file_download_stat.rb
sufia-5.0.0.rc1 sufia-models/app/models/file_download_stat.rb
sufia-models-5.0.0.rc1 app/models/file_download_stat.rb
sufia-6.0.0.rc2 sufia-models/app/models/file_download_stat.rb
sufia-models-6.0.0.rc2 app/models/file_download_stat.rb
sufia-6.0.0.rc1 sufia-models/app/models/file_download_stat.rb
sufia-models-6.0.0.rc1 app/models/file_download_stat.rb
sufia-4.3.1 sufia-models/app/models/file_download_stat.rb
sufia-models-4.3.1 app/models/file_download_stat.rb
sufia-6.0.0.beta1 sufia-models/app/models/file_download_stat.rb
sufia-models-6.0.0.beta1 app/models/file_download_stat.rb