MishkaCmsCore.Runtime.Resources.Calculations.VersionPreview (Mishka CMS Core v0.0.1)

Copy Markdown View Source

What a record said in one of its own versions, for a preview before a restore.

The :version_id argument must name a version of THE RECORD being loaded; any other version — of another record, or of another site's — answers nil, the same as a version that does not exist. The record itself was read as the caller, so the version is read as the system once it is known to be the record's own.

Options

  • :version — the resource's AshPaperTrail version resource. Required. It must have a :get_any read.

Usage

calculate :version_preview,
          :map,
          {MishkaCmsCore.Runtime.Resources.Calculations.VersionPreview,
           version: MishkaCmsCore.Runtime.Layout.Version} do
  argument :version_id, :uuid, allow_nil?: false
end

Summary

Functions

describe(opts)

Callback implementation for Ash.Resource.Calculation.describe/1.

has_calculate?()

has_expression?()

Callback implementation for Ash.Resource.Calculation.has_expression?/0.

load(query, opts, context)

Callback implementation for Ash.Resource.Calculation.load/3.

strict_loads?()

Callback implementation for Ash.Resource.Calculation.strict_loads?/0.