# `MishkaDocument.Resources.Changes.EnsureAddressPages`
[🔗](https://github.com/mishka-group/mishka_document/blob/v0.0.1/lib/mishka_document/resources/__changes/ensure_address_pages.ex#L5)

Gives a document the two pages its own address is read at, when the address is set — its front
page and every page of it (`MishkaDocument.Provision.ensure_address!/3`) — so an admin who writes
`/product/docs` on the form is answered there without building a page.

A page the site already has at either path is kept, its own design among them. The pages are
written as the writer, in the same transaction as the document: a writer who may not write pages
is refused before anything is saved, with what they are missing, unless the site already has
both — a document with an address is read there and nowhere else, so an address that answers
nothing leaves it unread. With no actor the system writes, as the seeds do.

Nothing happens when the address is not changing, or is emptied: a document read under `/docs`
again leaves the pages it had for the admin to keep or remove.

## Usage

    change MishkaDocument.Resources.Changes.EnsureAddressPages

---

*Consult [api-reference.md](api-reference.md) for complete listing*
