Merge pull request #3563 from consul/add_lines_count_rake
Add task to regenerate ballot_lines_count cache
This commit is contained in:
8
lib/tasks/regenerate_ballot_lines_cache.rake
Normal file
8
lib/tasks/regenerate_ballot_lines_cache.rake
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user