diff --git a/app/models/budget/stats.rb b/app/models/budget/stats.rb index d2226630a..24ba6fafc 100644 --- a/app/models/budget/stats.rb +++ b/app/models/budget/stats.rb @@ -3,11 +3,11 @@ class Budget::Stats alias_method :budget, :resource def self.stats_methods - %i[total_participants total_participants_support_phase total_participants_vote_phase - total_budget_investments total_votes total_selected_investments - total_unfeasible_investments total_male_participants total_female_participants - total_supports total_unknown_gender_or_age age_groups male_percentage - female_percentage headings total_participants_web total_participants_booths] + 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] end private diff --git a/app/models/concerns/statisticable.rb b/app/models/concerns/statisticable.rb index 4f83c2e74..6548df8c6 100644 --- a/app/models/concerns/statisticable.rb +++ b/app/models/concerns/statisticable.rb @@ -70,6 +70,12 @@ module Statisticable end class_methods do + def stats_methods + %i[total_participants total_male_participants + total_female_participants total_unknown_gender_or_age + male_percentage female_percentage age_groups] + end + def stats_cache(*method_names) method_names.each do |method_name| alias_method :"raw_#{method_name}", method_name