Ensure seeded listings are valid (#14784)
This matches the same change made to the db/seeds.rb file at https://github.com/forem/forem/blob/main/db/seeds.rb#L515 Since there's a validation that Listings are only 12 lines or shorter, and no technical limit on the length of `Faker::Markdown.random`'s output, take the first 10 lines only.
This commit is contained in:
parent
234156de7d
commit
3e5d399d82
1 changed files with 1 additions and 1 deletions
|
|
@ -465,7 +465,7 @@ seeder.create_if_none(Listing) do
|
|||
Listing.create!(
|
||||
user: admin_user,
|
||||
title: "Listing title",
|
||||
body_markdown: Faker::Markdown.random,
|
||||
body_markdown: Faker::Markdown.random.lines.take(10).join,
|
||||
location: Faker::Address.city,
|
||||
organization_id: admin_user.organizations.first&.id,
|
||||
listing_category_id: ListingCategory.first.id,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue