You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: populate.rb
    path of file: ./repos/danbooru/db
    
    the code of the file until where you have to start completion: #!/usr/bin/env ruby
#
# This script populates the database with random data for testing or developme
    
def populate_forum(n, posts_per_topic: 20)
  puts "*** Creating forum topics ***"

  n.times do |i|
    user = User.order("random()").first
    topic = CurrentUser.scoped(user) { ForumTopic.create(creator: user, title: Faker::Lorem.sentence, original_post_attributes: { creator: user, body: Faker::Lorem.paragraphs.join("\n\n") }) }

    rand(posts_per_topic).times do
      user = User.order("random()").first
      CurrentUser.scoped(user) { ForumPost.create(creator: user, topic: topic, body: Faker::Lorem.paragraphs.join("\n\n")) }
    end

    puts "Created topic ##{topic.id}"
  end
end