Feedback on Phoenix callbacks please

Hello, there is a post here Before create callback in Ecto. It’s probably more related to Ecto than to Phoenix.

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.

2 Likes