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"}
endOptions
:version- Required. The record's version resource. It needs a:get_anyread.: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 tofalse.
Summary
Functions
Callback implementation for Ash.Resource.Preparation.supports/1.
Callback implementation for Ash.Resource.Preparation.temporal_safe?/1.
Functions
Callback implementation for Ash.Resource.Preparation.supports/1.
Callback implementation for Ash.Resource.Preparation.temporal_safe?/1.