diff --git a/lib/tasks/regenerate_ballot_lines_cache.rake b/lib/tasks/regenerate_ballot_lines_cache.rake new file mode 100644 index 000000000..d008ec556 --- /dev/null +++ b/lib/tasks/regenerate_ballot_lines_cache.rake @@ -0,0 +1,8 @@ +namespace :budgets do + desc "Regenerate ballot_lines_count cache" + task calculate_ballot_lines: :environment do + Budget::Ballot.find_each do |ballot| + Budget::Ballot.reset_counters ballot.id, :lines + end + end +end