diff --git a/app/controllers/admin/stats_controller.rb b/app/controllers/admin/stats_controller.rb index 8cc5d712c..5543a2d1f 100644 --- a/app/controllers/admin/stats_controller.rb +++ b/app/controllers/admin/stats_controller.rb @@ -25,11 +25,11 @@ class Admin::StatsController < Admin::BaseController def proposal_notifications @proposal_notifications = ProposalNotification.all - @proposals_with_notifications = @proposal_notifications.pluck(:proposal_id).uniq + @proposals_with_notifications = @proposal_notifications.distinct.count(:proposal_id) end def direct_messages - @direct_messages = DirectMessage.all - @users_who_have_sent_message = DirectMessage.pluck(:sender_id).uniq + @direct_messages = DirectMessage.count + @users_who_have_sent_message = DirectMessage.distinct.count(:sender_id) end end diff --git a/app/views/admin/stats/direct_messages.html.erb b/app/views/admin/stats/direct_messages.html.erb index 432152db5..b87e2b3e3 100644 --- a/app/views/admin/stats/direct_messages.html.erb +++ b/app/views/admin/stats/direct_messages.html.erb @@ -7,14 +7,14 @@

<%= t("admin.stats.direct_messages.users_who_have_sent_message") %>
- <%= @users_who_have_sent_message.count %> + <%= @users_who_have_sent_message %>

diff --git a/app/views/admin/stats/proposal_notifications.html.erb b/app/views/admin/stats/proposal_notifications.html.erb index 75b1c04f5..79e19a247 100644 --- a/app/views/admin/stats/proposal_notifications.html.erb +++ b/app/views/admin/stats/proposal_notifications.html.erb @@ -7,14 +7,14 @@

<%= t("admin.stats.proposal_notifications.proposals_with_notifications") %>
- <%= @proposals_with_notifications.count %> + <%= @proposals_with_notifications %>