Remove redundant .all in .all.sample calls

Rubocop doesn't detect this method because we've added it in the
ApplicationRecord class, but we're removing the `.all` calls for
consistency.
This commit is contained in:
taitus
2023-11-08 14:07:17 +01:00
committed by Javi Martín
parent 0aee568977
commit 76837919b8
11 changed files with 49 additions and 49 deletions

View File

@@ -5,15 +5,15 @@ end
section "Creating Communities Topics" do
Community.find_each do |community|
Topic.create(community: community, author: User.all.sample,
Topic.create(community: community, author: User.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
author = User.sample
topic = Topic.sample
Comment.create!(user: author,
created_at: rand(topic.created_at..Time.current),
commentable: topic,