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 ```
23 lines
795 B
Ruby
23 lines
795 B
Ruby
section "Creating Communities" do
|
|
Proposal.find_each { |proposal| proposal.update(community: Community.create) }
|
|
Budget::Investment.find_each { |investment| investment.update(community: Community.create) }
|
|
end
|
|
|
|
section "Creating Communities Topics" do
|
|
Community.find_each do |community|
|
|
Topic.create(community: community, author: User.all.sample,
|
|
title: Faker::Lorem.sentence(word_count: 3).truncate(60), description: Faker::Lorem.sentence)
|
|
end
|
|
end
|
|
|
|
section "Commenting Community Topics" do
|
|
30.times do
|
|
author = User.all.sample
|
|
topic = Topic.all.sample
|
|
Comment.create!(user: author,
|
|
created_at: rand(topic.created_at..Time.current),
|
|
commentable: topic,
|
|
body: Faker::Lorem.sentence)
|
|
end
|
|
end
|