Generator for MishkaBlog resources.
- Test functions (no prefix): simple, deterministic — used by factory and tests.
- Dev functions (dev_ prefix): realistic, rich data — used by dev seeds.
Summary
Functions
A realistic English blog post whose lifecycle fields agree with its status: published posts carry a
published_at in the last 18 months, drafts carry neither date, and scheduled posts carry only a
scheduled_publish_at 31-45 days out. :archived is deliberately absent from the status pool —
that label is a separate axis from the archived_at soft delete and is written explicitly by the
seeds, never drawn at random.
A realistic comment. Moderation status is weighted the way a live queue looks — mostly approved with a thin tail of pending, spam and flagged rows — and pinning stays rare so the pinned marker keeps its meaning.
A plausible browser user agent, used by the seeds when writing post-view rows.
Functions
A realistic English blog post whose lifecycle fields agree with its status: published posts carry a
published_at in the last 18 months, drafts carry neither date, and scheduled posts carry only a
scheduled_publish_at 31-45 days out. :archived is deliberately absent from the status pool —
that label is a separate axis from the archived_at soft delete and is written explicitly by the
seeds, never drawn at random.
A COVER IS PASSED IN, never invented here. This drew one from two hardcoded paths under
/images/, which exist in the host application and in no other project, so the same generator
wrote a working cover in one repository and a 404 in the next. The seeds hand over a path from the
site's own media library — see MishkaBlog.Dev.Seeds — and nil is the common case a post list
still has to look right without.
A realistic comment. Moderation status is weighted the way a live queue looks — mostly approved with a thin tail of pending, spam and flagged rows — and pinning stays rare so the pinned marker keeps its meaning.
A plausible browser user agent, used by the seeds when writing post-view rows.