Skip to content

Commit c5d41cf

Browse files
committed
Improve readability of emails gen in seeds.rb.
1 parent 41d2295 commit c5d41cf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

test/db/seeds.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
login = Faker::Internet.username(specifier: legal_name) + rand(1..100).to_s
3535

3636
# Generate either 0, 1, or 2 emails:
37-
erand = rand
38-
emails = (erand < 0.1 ? 0 : erand > 0.9 ? 2 : 1).times.map do |i|
37+
emails = [ 0, *([ 1 ] * 8), 2 ].sample.times.map do |i|
3938
Email.create!(email: Faker::Internet.email(name: legal_name), is_primary: i == 0)
4039
end
4140

0 commit comments

Comments
 (0)