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 ```
17 lines
671 B
Ruby
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
|