app/models/file_view_stat.rb in sufia-7.0.0.beta4 vs app/models/file_view_stat.rb in sufia-7.0.0.rc1
- old
+ new
@@ -1,18 +1,8 @@
-class FileViewStat < ActiveRecord::Base
- extend Sufia::FileStatUtils
+class FileViewStat < Sufia::Statistic
+ self.cache_column = :views
+ self.event_type = :pageviews
- 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)
+ def self.filter(file)
+ { file_id: file.id }
end
end