Ecto is a little bit different, as there is no callbacks. But as You did allow to mimic before callback. Ecto.Multi is used to perform multiple operation in a single transaction. Which could be seen as after callback.
You could use Ecto.Multi to implement behaviours like acts_as_list, acts_as_nested_set, counter_cache etc.
Thanks for the feedback @kokolegorille, but I don’t want to implement callbacks in Phoenix, I want to embrace it’s decision to not use callbacks.
I search for callbacks while trying to enforce the user creation to always have an API token. I decided to put this enforcement in the changeset function. I would like to hear from more experienced developers if this is a good place or if there is a better one?