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

@@ -1,8 +1,8 @@
section "Commenting Investments, Debates & Proposals" do
%w[Budget::Investment Debate Proposal].each do |commentable_class|
100.times do
commentable = commentable_class.constantize.all.sample
Comment.create!(user: User.all.sample,
commentable = commentable_class.constantize.sample
Comment.create!(user: User.sample,
created_at: rand(commentable.created_at..Time.current),
commentable: commentable,
body: Faker::Lorem.sentence)
@@ -12,8 +12,8 @@ end
section "Commenting Comments" do
200.times do
parent = Comment.all.sample
Comment.create!(user: User.all.sample,
parent = Comment.sample
Comment.create!(user: User.sample,
created_at: rand(parent.created_at..Time.current),
commentable_id: parent.commentable_id,
commentable_type: parent.commentable_type,