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