Change all posts by user to wiki: After migrating a knowledgebase from MediaWiki to Discourse, jomaxro is looking to change all posts to wiki via a rake command. However, codinghorror is not aware of a direct method.
cpradio suggests using the Rails console, while riking provides a working solution: u = User.find_by_username('abc'); Post.where(user: u).each do |p| p.wiki = true; p.save; end. This method successfully changes all posts by a specific user to wiki. jomaxro confirms that this solution works, but notes that it does not affect “About this Category” pages, which must be updated manually.
I think this is mostly knowing Ruby/Rails at this point, p becomes an enumeration, so figuring out how to call a method on each item in the enumeration would be the solution. I just haven’t had a chance to google that yet.
Another site, thanks @sam. We’re self hosting a site at the university where I work for an internal help desk knowledge base. We’re just finishing manually importing from MediaWiki.
Thanks @riking! Just tried that and it worked! Unfortunately, I overlooked the fact that About this Category pages were owned by the user, but it was easy enough to disable wiki via the UI for the 10 or so category topics.