Attached.Variants.Variant (Attached v0.1.1)

Copy Markdown View Source

A cached derivation of an Attached.Originals.Original.

Variants are produced on demand from a parent original and a named transform declared on the parent schema (e.g. :thumb, :preview). Each variant is identified by (original_id, transform_digest) — the digest captures the full transform configuration, so changing a variant definition produces a new digest and a new cached variant, leaving the old one as an orphan to be reaped.

Variants have no key of their own. Their storage path derives from the parent original's key plus the variant's name and transform digest.

See Attached.Originals.Original for the original-file schema.

Summary

Functions

changeset(variant \\ %__MODULE__{}, attrs)