2018-04-18 15:30:41 -04:00
|
|
|
class AdminDashboardNextData
|
|
|
|
include StatsCacheable
|
|
|
|
|
|
|
|
def initialize(opts = {})
|
|
|
|
@opts = opts
|
|
|
|
end
|
|
|
|
|
2018-07-19 14:33:11 -04:00
|
|
|
def self.fetch_stats
|
|
|
|
new.as_json
|
2018-06-20 17:15:11 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_json
|
2018-07-19 14:33:11 -04:00
|
|
|
{}
|
2018-04-18 15:30:41 -04:00
|
|
|
end
|
|
|
|
|
2018-07-19 14:33:11 -04:00
|
|
|
def as_json(_options = nil)
|
|
|
|
@json ||= get_json
|
2018-04-18 15:30:41 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.reports(source)
|
|
|
|
source.map { |type| Report.find(type).as_json }
|
|
|
|
end
|
2018-07-19 14:33:11 -04:00
|
|
|
|
|
|
|
def self.stats_cache_key
|
2018-07-31 17:35:13 -04:00
|
|
|
"dashboard-next-data-#{Report::SCHEMA_VERSION}"
|
2018-07-19 14:33:11 -04:00
|
|
|
end
|
2018-04-18 15:30:41 -04:00
|
|
|
end
|