adds stats for direct messages and proposal notifications

This commit is contained in:
rgarcia
2016-06-16 17:42:16 +02:00
parent 31fc2ae927
commit 0abc9c8376
6 changed files with 95 additions and 1 deletions

View File

@@ -21,6 +21,15 @@ class Admin::StatsController < Admin::BaseController
@user_ids_who_voted_proposals = ActsAsVotable::Vote.where(votable_type: 'Proposal').distinct.count(:voter_id)
@user_ids_who_didnt_vote_proposals = @verified_users - @user_ids_who_voted_proposals
@spending_proposals = SpendingProposal.count
end
def proposal_notifications
@proposal_notifications = ProposalNotification.all
@proposals_with_notifications = @proposal_notifications.pluck(:proposal_id).uniq
end
def direct_messages
@direct_messages = DirectMessage.all
@users_who_have_sent_message = DirectMessage.pluck(:sender_id).uniq
end
end