Ash.Resource.Change behaviour (ash v1.51.2) View Source

The behaviour for an action-specific resource change.

To implement one, simply implement the behaviour. init/1 is defined automatically by use Ash.Resource.Change, but can be implemented if you want to validate/transform any options passed to the module.

The main function is change/3. It takes the changeset, any options that were provided when this change was configured on a resource, and the context, which currently only has the actor.

Link to this section Summary

Link to this section Types


context() :: %{actor: Ash.Resource.record()} | %{}


t() :: %Ash.Resource.Change{
  change: term(),
  on: term(),
  only_when_valid?: term(),
  where: term()

Link to this section Functions

Link to this section Callbacks

Link to this callback

change(arg1, arg2, context)

View Source



init(Keyword.t()) :: {:ok, Keyword.t()} | {:error, term()}