MishkaDocument. Resources. Changes. AutoApplyNoteDraft
(Mishka Document v0.0.1)
Copy Markdown
View Source
Automatically applies note draft changes when both approvals are granted.
This change is triggered on NoteDraft update actions. When both content_review_status and technical_review_status are set to :approved, it automatically applies the note.
A draft of an existing note writes only the fields it changes (its changed_fields, kept by
MishkaDocument.Resources.Changes.StartFromSource); a draft of a new note writes all of itself.
The note is written, and the draft marked applied, as whoever approved the draft, in the draft's site, so the resources' own policies answer for the approval too. The note and the section draft it depends on are looked up by id without the approver's read policies, since a lookup of a row the draft names must find it whatever the approver may list.
Summary
Functions
Callback implementation for Ash.Resource.Change.change/3.
Functions
Callback implementation for Ash.Resource.Change.change/3.