Skip to content

Commit

Permalink
Add rake task to reset the cached votes counter
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoorai2000 committed Dec 26, 2017
1 parent 96066ae commit 2b9b78e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/tasks/votes.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace :votes do

desc "Resets cached_votes_up counter to its latest value"
task reset_vote_counter: :environment do
models = [Proposal, Budget::Investment]

models.each do |model|
model.find_each do |resource|
resource.update_cached_votes
print "."
end
end

end

end

0 comments on commit 2b9b78e

Please sign in to comment.