Looking for an example of an attribute-based custom filter check I once saw in an error message.

I saw once it in an error message, but can't find it anywhere online. It would correspond to this passage in the documentation, for create actions:
Keep in mind that, for create actions, many expr/1 checks won’t make sense, and may return false when you wouldn’t expect. Expression (and other filter) policies apply to “a synthesized result” of applying the action, so related values won’t be available. For this reason, you may end up wanting to use other checks that are built for working against changesets, or only simple attribute-based filter checks. Custom checks may also be warranted here.
Keep in mind that, for create actions, many expr/1 checks won’t make sense, and may return false when you wouldn’t expect. Expression (and other filter) policies apply to “a synthesized result” of applying the action, so related values won’t be available. For this reason, you may end up wanting to use other checks that are built for working against changesets, or only simple attribute-based filter checks. Custom checks may also be warranted here.
2 Replies
ZachDaniel
ZachDaniel2y ago
Ash HQ
Guide: Policies
Read the "Policies" guide on Ash HQ
ZachDaniel
ZachDaniel2y ago
And then there is a changeset key in the state you can use for create/update/destroy actions

Did you find this page helpful?