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 <jamie@forem.com> Co-authored-by: Jamie Gaskins <jamie@forem.com>
This commit is contained in:
parent
61eed20876
commit
2a75ec8ecc
1 changed files with 1 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue