diff --git a/softdeldeletedposts.rb b/softdeldeletedposts.rb index dd4edb2..e5d6239 100644 --- a/softdeldeletedposts.rb +++ b/softdeldeletedposts.rb @@ -56,7 +56,10 @@ class GossamerForumsSoftDelDeletedPosts < ImportScripts::Base puts " - Topic title: '#{topic.title}' (Topic ID: #{topic.id})" # Perform the soft delete by updating the fields - post.update(deleted_at: Time.now, deleted_by_id: deleted_by_id) + ## post.deleted_at = Time.now + ## post.deleted_by_id = deleted_by_id + ## post.save + ### post.update(deleted_at: Time.now, deleted_by_id: deleted_by_id) else puts "SoftDelDeletedPosts: Post with id: #{post.id} is already soft deleted." end @@ -106,7 +109,7 @@ def soft_undelete_post(post) puts " - Topic title: '#{topic.title}' (Topic ID: #{topic.id})" # Reverse the soft delete by setting deleted_at and deleted_by_id to nil - post.update(deleted_at: nil, deleted_by_id: nil) + ### post.update(deleted_at: nil, deleted_by_id: nil) else puts "SoftDelDeletedPosts: Post with id: #{post.id} is not soft deleted." end