diff --git a/lib/tasks/tags.rake b/lib/tasks/tags.rake new file mode 100644 index 000000000..c4af963cc --- /dev/null +++ b/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