discourse/app/models/admin_dashboard_next_data.rb
Joffrey JAFFEUX 1a78e12f4e
FEATURE: part 2 of dashboard improvements
- moderation tab
- sorting/pagination
- improved third party reports support
- trending charts
- better perf
- many fixes
- refactoring
- new reports

Co-Authored-By: Simon Cossar <scossar@users.noreply.github.com>
2018-07-19 14:33:11 -04:00

32 lines
448 B
Ruby

class AdminDashboardNextData
include StatsCacheable
def initialize(opts = {})
@opts = opts
end
def self.fetch_stats
self.class.new.as_json
end
def self.fetch_stats
new.as_json
end
def get_json
{}
end
def as_json(_options = nil)
@json ||= get_json
end
def self.reports(source)
source.map { |type| Report.find(type).as_json }
end
def self.stats_cache_key
'dashboard-next-data'
end
end