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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user