Files
grecia/db/dev_seeds/votes.rb
taitus 76837919b8 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.
2023-11-20 14:23:41 +01:00

23 lines
626 B
Ruby

section "Voting Debates, Proposals & Comments" do
not_org_users = User.where.not(id: User.organizations)
100.times do
voter = not_org_users.level_two_or_three_verified.sample
vote = [true, false].sample
debate = Debate.sample
debate.vote_by(voter: voter, vote: vote)
end
100.times do
voter = not_org_users.sample
vote = [true, false].sample
comment = Comment.sample
comment.vote_by(voter: voter, vote: vote)
end
100.times do
voter = not_org_users.level_two_or_three_verified.sample
proposal = Proposal.sample
proposal.vote_by(voter: voter, vote: true)
end
end