Sha256: f444a8090e2edc459ef47cdf1804c9f4fb42157151660550133ad87ae9a0c6c0

Contents?: true

Size: 641 Bytes

Versions: 4

Compression:

Stored size: 641 Bytes

Contents

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

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

  def self.statistics(file_id, start_date, user_id = nil)
    combined_stats file_id, start_date, :views, :pageviews, 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)
    path = Rails.application.routes.url_helpers.curation_concerns_file_set_path(file_id)
    Sufia::Analytics.profile.sufia__pageview(sort: 'date', start_date: start_date).for_path(path)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sufia-7.0.0.beta4 app/models/file_view_stat.rb
sufia-7.0.0.beta3 app/models/file_view_stat.rb
sufia-7.0.0.beta2 app/models/file_view_stat.rb
sufia-7.0.0.beta1 app/models/file_view_stat.rb