diff --git a/script/import_scripts/base.rb b/script/import_scripts/base.rb index 2db79eeee..0996c3523 100644 --- a/script/import_scripts/base.rb +++ b/script/import_scripts/base.rb @@ -235,10 +235,6 @@ class ImportScripts::Base PostCreator.create(user, opts) end - def update_bumped_at - Post.exec_sql("update topics t set bumped_at = (select max(created_at) from posts where topic_id = t.id)") - end - def close_inactive_topics(opts={}) num_days = opts[:days] || 30 puts '', "Closing topics that have been inactive for more than #{num_days} days." @@ -254,6 +250,10 @@ class ImportScripts::Base end end + def update_bumped_at + Post.exec_sql("update topics t set bumped_at = (select max(created_at) from posts where topic_id = t.id and post_type != #{Post.types[:moderator_action]})") + end + def print_status(current, max) print "\r%9d / %d (%5.1f%%) " % [current, max, ((current.to_f / max.to_f) * 100).round(1)] end