MishkaDocument.Resources.Changes.SetVersionAttributes (Mishka Document v0.0.1)

Copy Markdown View Source

Change module for setting custom version attributes from context.

This change is used by PaperTrail version resources to populate custom attributes (change_description, change_version, review statuses) from the context when a version record is created.

Using a proper Change module with atomic support avoids warnings about non-atomic updates on version resources.

Summary

Functions

Declares this change as atomic-compatible.

Functions

atomic(changeset, opts, context)

Declares this change as atomic-compatible.

Version attribute changes can be done atomically at the database level since they're simple attribute assignments.

change(changeset, opts, context)

Callback implementation for Ash.Resource.Change.change/3.