Ash FrameworkAF
Ash Framework3y ago
1 reply
Blibs

Transaction between separated actions

I believe I already have the answer for that, but I just want to double check if that is the best/correct way to do it with Ash.

If I have two actions, say, User.add!() and Marketing.add!() and want to run them inside the same transaction, should I just do this?

Repo.transaction(fn ->
  User.add!(args)
  Marketing.add!(args)
end)
Was this page helpful?