Phoenix Framework callbacks

wohlert

Does the Phoenix Framework employ any types of callback filter such as those found in Rails? I know it is possible to validate changesets, but I am looking for ways to implement actions such as before_create, before_save and after_commit.

José Valim

Ecto does: https://hexdocs.pm/ecto/#!Ecto.Model.Callbacks.html

They are sightly different from the Rails ones: they receive and must return changesets and must be used for data consistency (don't use them to send e-mails and what not).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related