More goss-cleanup improvements

This commit is contained in:
David Sainty 2024-08-29 23:24:36 +10:00
parent 22175ae2c8
commit 0ad3fad36c
2 changed files with 19 additions and 7 deletions

View File

@ -83,13 +83,13 @@ class GossamerForumsCleaner
puts "Identified topic for deletion: Title: #{topic.title} Topic ID: #{topic.id}"
# Destroy all posts in the topic
# topic.posts.each do |post|
# puts "Deleting post #{post.id} in topic #{topic.id}"
# post.destroy
# end
#
# # Destroy the topic itself
# topic.destroy
topic.posts.each do |post|
puts "Deleting post #{post.id} in topic #{topic.id}"
post.destroy
end
# Destroy the topic itself
topic.destroy
end
end

View File

@ -27,6 +27,18 @@ class GossamerForumsSearch
puts "Bumped At: #{topic.bumped_at}"
puts "Last Post User ID: #{topic.last_post_user_id}"
puts "----------------------------------------"
# Fetch and display all posts for the topic
topic.posts.each do |post|
puts " Post ID: #{post.id}"
puts " User ID: #{post.user_id}"
puts " Created At: #{post.created_at}"
puts " Updated At: #{post.updated_at}"
puts " Post Number: #{post.post_number}"
puts " Cooked: #{post.cooked.truncate(80)}" # Limit the display of post content to 100 characters
puts " Raw: #{post.raw.truncate(80)}" # Limit the display of raw post content to 100 characters
puts " ----------------------------------------"
end
end
if matching_topics.empty?