# `MishkaBlog.Resources.Preparations.PreviewVersion`
[🔗](https://github.com/mishka-group/mishka_blog/blob/v0.0.1/lib/mishka_blog/resources/__preparations/preview_version.ex#L5)

Turns a read of one record into a preview of it as it was in one of its own versions, named by the
read's `:version_id` argument. Nothing is saved.

The version is read as the caller, with no tenant when `:master` is set. A version of any other
record is refused with `MishkaBlog.Resources.Changes.RestoreVersion.refusal/1`, and one that
cannot be read comes back as the read's own error. Nothing raises.

## Usage

    read :preview_version do
      get? true

      argument :tag_id, :uuid, allow_nil?: false
      argument :version_id, :uuid, allow_nil?: false

      filter expr(id == ^arg(:tag_id))

      prepare {MishkaBlog.Resources.Preparations.PreviewVersion,
               version: MishkaBlog.Tag.Version,
               label: "tag"}
    end

## Options

* `:version` - Required. The record's version resource. It needs a `:get_any` read.
* `:label` - Required. How the refusal names the record, such as "tag".
* `:fields` - The attributes taken from the version. Defaults to every field of the record.
* `:cast` - Fields whose string value is read through the attribute's own type.
* `:master` - Read the version with no tenant. Defaults to `false`.

# `supports`

# `temporal_safe?`

---

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