From 2a75ec8ecc40571d194b8f999890feed9fc46518 Mon Sep 17 00:00:00 2001 From: Daniel Uber Date: Wed, 8 Sep 2021 17:54:53 -0500 Subject: [PATCH] When calling Faker::Markdown, avoid "sandwich" method (#14685) * When calling Faker::Markdown, avoid "sandwich" method Since random can also be selected by random (without the exclude list), avoid calling sandwich occassionally from random's call to random. This avoids generating body_markdown exceeding 12 newlines (which is validated in Listing and prevents save, breaking the seeds process). * just take 10 lines, don't be clever Co-authored-by: Jamie Gaskins Co-authored-by: Jamie Gaskins --- db/seeds.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/seeds.rb b/db/seeds.rb index 25b85fd42..18ddccc87 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -512,7 +512,7 @@ seeder.create_if_none(Listing) do Listing.create!( user: user, title: Faker::Lorem.sentence, - body_markdown: Faker::Markdown.random, + body_markdown: Faker::Markdown.random.lines.take(10).join, location: Faker::Address.city, organization_id: user.organizations.first&.id, listing_category_id: category_id,