[Proposal] Receive the previous value in the validator function in validate_change

11 views
Skip to first unread message

Alex Castaño

unread,
Aug 14, 2023, 9:07:47 AM8/14/23
to elixir-ecto
Hello,

I think it could be interesting to optionally receive a third argument with the previous value in the validator function of `validate_change/3,4`. It is useful when you want to validate that the change from the old value to the new value is a valid change, and not only the final value.

We can keep retro compatibility because we can still pass a function of arity 2. If you think it is a nice feature, I'm happy to provide a PR that implements it.

Thank you!

Reply all
Reply to author
Forward
0 new messages