Skip to content

Instantly share code, notes, and snippets.

@frankie-loves-jesus
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankie-loves-jesus/9797757 to your computer and use it in GitHub Desktop.
Save frankie-loves-jesus/9797757 to your computer and use it in GitHub Desktop.
unless user.nil?
forum = Forem::Forum.find_or_create_by_name(:category_id => Forem::Category.first.id, :name => "Default", :description => "Default forem created by install")
#########
topic1 = forum.topics.build({ :subject => "Test", :posts_attributes => [:text => "Hello World"] })
topic1.user = user
topic1.save!
#########
topic2 = forum.topics.build({ :subject => "Test", :posts_attributes => [:text => "Hello World"] })
topic2.user = user
topic2.save!
#########
topic3 = forum.topics.build({ :subject => "Test", :posts_attributes => [:text => "Hello World"] })
topic3.user = user
topic3.save!
#########
topic4 = forum.topics.build({ :subject => "Test", :posts_attributes => [:text => "Hello World"] })
topic4.user = user
topic4.save!
#########
topic5 = forum.topics.build({ :subject => "Test", :posts_attributes => [:text => "Hello World"] })
topic5.user = user
topic5.save!
#########
topic6 = forum.topics.build({ :subject => "Test", :posts_attributes => [:text => "Hello World"] })
topic6.user = user
topic6.save!
#########
topic7 = forum.topics.build({ :subject => "Test", :posts_attributes => [:text => "Hello World"] })
topic7.user = user
topic7.save!
#########
topic8 = forum.topics.build({ :subject => "Test", :posts_attributes => [:text => "Hello World"] })
topic8.user = user
topic8.save!
#########
topic9 = forum.topics.build({ :subject => "Test", :posts_attributes => [:text => "Hello World"] })
topic9.user = user
topic9.save!
#########
topic10 = forum.topics.build({ :subject => "Test", :posts_attributes => [:text => "Hello World"] })
topic10.user = user
topic10.save!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment