Add a count of blocked users on the dashboard

This commit is contained in:
Neil Lalonde
2013-06-04 11:53:19 -04:00
parent e3861893a2
commit 2259e97d42
8 changed files with 23 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ class AdminDashboardData
reports: REPORTS.map { |type| Report.find(type).as_json },
admins: User.admins.count,
moderators: User.moderators.count,
blocked: User.blocked.count,
top_referrers: IncomingLinksReport.find('top_referrers').as_json,
top_traffic_sources: IncomingLinksReport.find('top_traffic_sources').as_json,
top_referred_topics: IncomingLinksReport.find('top_referred_topics').as_json

View File

@@ -61,6 +61,7 @@ class User < ActiveRecord::Base
scope :admins, ->{ where(admin: true) }
scope :moderators, ->{ where(moderator: true) }
scope :staff, ->{ where("moderator or admin ") }
scope :blocked, ->{ where(blocked: true) } # no index
module NewTopicDuration
ALWAYS = -1