updates dev seeds with comments for poll questions
This commit is contained in:
@@ -403,4 +403,15 @@ end
|
||||
|
||||
10.times.each_with_index do |i|
|
||||
Poll::Booth.create(name: "Booth #{i}", poll: Poll.all.sample)
|
||||
end
|
||||
|
||||
puts "Commenting Poll Questions"
|
||||
|
||||
(1..30).each do |i|
|
||||
author = User.reorder("RANDOM()").first
|
||||
question = Poll::Question.reorder("RANDOM()").first
|
||||
Comment.create!(user: author,
|
||||
created_at: rand(question.created_at .. Time.now),
|
||||
commentable: question,
|
||||
body: Faker::Lorem.sentence)
|
||||
end
|
||||
Reference in New Issue
Block a user