---
url: /reference/models/page-version.md
---
# PageVersion

Version history for [pages](/reference/models/page): every snapshot of a versioned page's content and image. There is always exactly one *current* version per page; the others are archived.

## Columns

| Column | Type | Notes |
| --- | --- | --- |
| `page_id` | bigint | required |
| `name` | string | version label, auto-generated from the page title and date |
| `content` | jsonb | ProseMirror content snapshot |
| `image_data` | jsonb | Shrine attachment snapshot |
| `current_since` | datetime | set ⇔ this is the current version |

## Behavior

* `belongs_to :page` — with `Page#versions` ordered most recent first
* Validations guarantee **one and only one** current version per page
* `after_initialize` sets a default name like `"Page title (2026-06-10)"`, the date in the current locale's format (`10/06/2026` in French)
* Includes [Sectionable](/reference/concerns/sectionable), `RecordImageUploader::Attachment(:image)` and `strip_attributes`

## Notable methods

| Method | Returns |
| --- | --- |
| `current?` | whether this version is the live one |
| `other_versions` | the page's other versions |
| `current_image` / `current_image_url` | this version's image |

See [Versionable](/reference/concerns/versionable) for the page-side API (`create_current_version_from_page!`, `current_content`…).
