diff --git a/app/components/admin/stats/budget_balloting_component.html.erb b/app/components/admin/stats/budget_balloting_component.html.erb index c76967f32..1bb7edb24 100644 --- a/app/components/admin/stats/budget_balloting_component.html.erb +++ b/app/components/admin/stats/budget_balloting_component.html.erb @@ -44,7 +44,7 @@
| <%= t("admin.stats.budget_balloting.participants_per_district") %> | - <% user_count_by_district.each do |heading_name, count| %> + <% user_count_by_heading.each do |heading_name, count| %>
|---|
| <%= heading_name %> diff --git a/app/components/admin/stats/budget_balloting_component.rb b/app/components/admin/stats/budget_balloting_component.rb index b08bce488..de1b06a0f 100644 --- a/app/components/admin/stats/budget_balloting_component.rb +++ b/app/components/admin/stats/budget_balloting_component.rb @@ -19,7 +19,7 @@ class Admin::Stats::BudgetBallotingComponent < ApplicationComponent budget.lines.group(:heading_id).count.map { |k, v| [Budget::Heading.find(k).name, v] }.sort end - def user_count_by_district + def user_count_by_heading User.where.not(balloted_heading_id: nil).group(:balloted_heading_id).count.map { |k, v| [Budget::Heading.find(k).name, v] }.sort end end |