mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 05:23:03 +12:00
docs: small tweak to lifecycle example
This commit is contained in:
parent
d738e56fac
commit
1cb544ddfa
1 changed files with 2 additions and 2 deletions
|
@ -114,12 +114,12 @@ defmodule AshChangesetLifeCycleExample do
|
|||
end)
|
||||
# execute code before the transaction is started. Use for things like external calls
|
||||
|> Changeset.before_transaction(fn changeset -> changeset end)
|
||||
# execute code in the transaction, before the data layer is called
|
||||
|> Changeset.before_action(fn changeset -> changeset end)
|
||||
# execute code in the transaction, before and after the data layer is called
|
||||
|> Changeset.around_action(fn changeset, callback ->
|
||||
callback.(changeset)
|
||||
end)
|
||||
# execute code in the transaction, before the data layer is called
|
||||
|> Changeset.before_action(fn changeset -> changeset end)
|
||||
# execute code in the transaction, after the data layer is called, only if the action is successful
|
||||
|> Changeset.after_action(fn changeset, result -> {:ok, result} end)
|
||||
# execute code after the transaction, both in success and error cases
|
||||
|
|
Loading…
Reference in a new issue