Files
nairobi/db/dev_seeds/notifications.rb
Javi Martín 102cf74b3d Bump faker from 1.8.7 to 2.0
Since version 2.0 introduced many breaking changes, we're upgrading to
it first.

The changes have been done by installing the rubocop-faker gem and
running:

```
rubocop \
  --require rubocop-faker \
  --only Faker/DeprecatedArguments \
  --auto-correct
```
2021-08-13 04:39:44 +02:00

17 lines
671 B
Ruby

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