Import scripts: don't include moderator_action posts when calculating bumped_at

This commit is contained in:
Neil Lalonde 2014-06-04 18:21:45 -04:00
parent 24cde6c604
commit 08346974cf

View file

@ -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