diff --git a/app/models/budget/stats.rb b/app/models/budget/stats.rb index 3f834fe5b..e063756c4 100644 --- a/app/models/budget/stats.rb +++ b/app/models/budget/stats.rb @@ -6,8 +6,7 @@ class Budget::Stats super + %i[total_participants_support_phase total_participants_vote_phase total_budget_investments total_votes total_selected_investments - total_unfeasible_investments total_supports headings - total_participants_web total_participants_booths] + total_unfeasible_investments headings] end def participants @@ -24,14 +23,6 @@ class Budget::Stats voters.uniq.count end - def total_participants_web - (balloters - poll_ballot_voters).uniq.compact.count - end - - def total_participants_booths - poll_ballot_voters.uniq.count - end - def total_participants_vote_phase (balloters + poll_ballot_voters).uniq.count end @@ -52,10 +43,6 @@ class Budget::Stats budget.investments.unfeasible.count end - def total_supports - supports(budget).count - end - def authors budget.investments.pluck(:author_id) end diff --git a/app/views/budgets/stats/show.html.erb b/app/views/budgets/stats/show.html.erb index 34f0f2c75..d4064ab90 100644 --- a/app/views/budgets/stats/show.html.erb +++ b/app/views/budgets/stats/show.html.erb @@ -82,13 +82,9 @@

<%= t("stats.budgets.by_phase") %>

<%= number_with_info_tags(@stats[:total_participants_support_phase], - t("stats.budgets.participants")) %> - - <%= number_with_info_tags(@stats[:total_supports], t("stats.budgets.supports")) %> - <%= number_with_info_tags(@stats[:total_participants_web], - t("stats.budgets.total_participants_web")) %> - <%= number_with_info_tags(@stats[:total_participants_booths], - t("stats.budgets.total_participants_booths")) %> + t("stats.budgets.participants_support_phase")) %> + <%= number_with_info_tags(@stats[:total_participants_vote_phase], + t("stats.budgets.participants_voting_phase")) %> diff --git a/config/locales/en/stats.yml b/config/locales/en/stats.yml index 68bb5144c..585d31955 100644 --- a/config/locales/en/stats.yml +++ b/config/locales/en/stats.yml @@ -23,10 +23,6 @@ en: total_selected_investments: "Projects in final voting phase" total_unfeasible_investments: "Unfeasible projects" by_phase: "Participants by phase" - total_participants_web: "Vote phase web participants" - total_participants_booths: "Vote phase booth participants" - participants: "Participants" - supports: "Supports" by_heading: "Participants by phase and heading" total: "Total" heading: "Heading" diff --git a/config/locales/es/stats.yml b/config/locales/es/stats.yml index b42af056f..5c0383cce 100644 --- a/config/locales/es/stats.yml +++ b/config/locales/es/stats.yml @@ -23,10 +23,6 @@ es: total_selected_investments: "Proyectos en la fase final" total_unfeasible_investments: "Proyectos inviables" by_phase: "Participación por fases" - total_participants_web: "Participantes web en votación final" - total_participants_booths: "Participantes en urnas votación final" - participants: "Participantes" - supports: "Apoyos" by_heading: "Participación por distritos y fase" total: "Total" heading: "Distrito" diff --git a/spec/models/budget/stats_spec.rb b/spec/models/budget/stats_spec.rb index 6868434b1..f56ba3c1d 100644 --- a/spec/models/budget/stats_spec.rb +++ b/spec/models/budget/stats_spec.rb @@ -94,24 +94,6 @@ describe Budget::Stats do end end - describe "#total_participants_web" do - it "returns the number of total participants in the votes phase via web" do - 2.times { create(:budget_ballot_line, investment: investment) } - create(:poll_voter, :from_booth, budget: budget) - - expect(stats.generate[:total_participants_web]).to be 2 - end - end - - describe "#total_participants_booths" do - it "returns the number of total participants in the votes phase in booths" do - 2.times { create(:poll_voter, :from_booth, budget: budget) } - create(:budget_ballot_line, investment: investment) - - expect(stats.generate[:total_participants_booths]).to be 2 - end - end - describe "#total_budget_investments" do it "returns the number of total budget investments" do 2.times { create(:budget_investment, budget: budget) } @@ -150,14 +132,6 @@ describe Budget::Stats do end end - describe "#total_supports" do - it "returns the number of total supports" do - 2.times { create(:vote, votable: investment) } - - expect(stats.generate[:total_supports]).to be 2 - end - end - describe "Participants by gender" do before do 3.times { create(:user, gender: "male") }