Files
nairobi/db/dev_seeds/notifications.rb
Javi Martín ad14636255 Use Tag instead of ActsAsTaggableOn::Tag
It's shorter, it's easier to extend its behaviour, and it's easier to
integrate with other parts of our application, like translations.
2019-10-05 03:38:44 +02:00

17 lines
697 B
Ruby

section "Creating comment notifications" do
User.find_each do |user|
debate = Debate.create!(author: user,
title: Faker::Lorem.sentence(3).truncate(60),
description: "<p>#{Faker::Lorem.paragraphs.join("</p><p>")}</p>",
tag_list: Tag.all.sample(3).join(","),
geozone: Geozone.reorder("RANDOM()").first,
terms_of_service: "1")
comment = Comment.create!(user: User.reorder("RANDOM()").first,
body: Faker::Lorem.sentence,
commentable: debate)
Notification.add(user, comment)
end
end