diff --git a/script/import_scripts/base.rb b/script/import_scripts/base.rb index 9eac081a9..273b0edc6 100644 --- a/script/import_scripts/base.rb +++ b/script/import_scripts/base.rb @@ -76,6 +76,7 @@ class ImportScripts::Base update_feature_topic_users update_category_featured_topics update_topic_count_replies + reset_topic_counters puts "", "Done" @@ -478,6 +479,19 @@ class ImportScripts::Base end end + def reset_topic_counters + puts "", "reseting topic counters" + + total_count = Topic.count + progress_count = 0 + + Topic.find_each do |topic| + Topic.reset_highest(topic.id) + progress_count += 1 + print_status(progress_count, total_count) + end + end + def update_category_featured_topics puts "", "updating featured topics in categories"