Skip to content

Commit

Permalink
Adds rake task for recalculating tag custom counters
Browse files Browse the repository at this point in the history
  • Loading branch information
kikito committed Sep 17, 2015
1 parent f9101b4 commit d6db238
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/tasks/tags.rake
@@ -0,0 +1,11 @@
namespace :tags do
desc "Recalculates the debate and proposals counters"
task custom_count: :environment do
ActsAsTaggableOn::Tag.find_in_batches do |tasks|
tasks.each do |task|
task.recalculate_custom_counter_for('Debate')
task.recalculate_custom_counter_for('Proposal')
end
end
end
end

0 comments on commit d6db238

Please sign in to comment.