The callback 'cast/1' is only called when loading native types from the database for some reason, what's counter-intuitive IMO but that's Ecto's fault.
I did check Ecto's docs and it states that it's dump/1's reponsability to validate and convert the given value to a native time, that's why I'm considering this a bugfix.
The callback 'cast/1' is only called when loading native types from the database for some reason, what's counter-intuitive IMO but that's Ecto's fault.
I did check Ecto's docs and it states that it's
dump/1
's reponsability to validate and convert the given value to a native time, that's why I'm considering this a bugfix.See https://hexdocs.pm/ecto/Ecto.Type.html#c:dump/1.