elixirmoney / money

Elixir library for working with Money safer, easier, and fun... Is an interpretation of the Fowler's Money pattern in fun.prog.
https://hex.pm/packages/money/
MIT License
826 stars 139 forks source link

Bugfix: `Currency.Type.dump/1` missing ISO string support #201

Closed rwillians closed 1 year ago

rwillians commented 1 year ago

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.

Nitrino commented 1 year ago

@rwillians Thank you for your contribution