updates dev seeds with comments for poll questions
This commit is contained in:
@@ -404,3 +404,14 @@ end
|
|||||||
10.times.each_with_index do |i|
|
10.times.each_with_index do |i|
|
||||||
Poll::Booth.create(name: "Booth #{i}", poll: Poll.all.sample)
|
Poll::Booth.create(name: "Booth #{i}", poll: Poll.all.sample)
|
||||||
end
|
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