kipcole9 / money

Elixir implementation of Money with Currency
https://hex.pm/packages/ex_money
Other
572 stars 48 forks source link

Backwards compatibility with latest release? #123

Closed coladarci closed 3 years ago

coladarci commented 3 years ago

This is totally on us with a bad decision, but out of curiosity, how hard would it be to make the latest change backwards compatible for Money objects stored in ETF Pre release?

KeyError: key :format_options not found in: #Money<:USD, 4497.81>
  File "lib/money.ex", line 707, in Money.to_string/2
  File "lib/money.ex", line 766, in Money.to_string!/2

🤦‍♂️

kipcole9 commented 3 years ago

Ahhh, so this is coming from :erlang.binary_to_term/1? Its a good point and its on me (too) since backwards compatibility is important. Let me do some experiments today and see if I can make that work.

coladarci commented 3 years ago

I’m not sure it’s fair to say it’s on you - your library IS backwards compatible, it just makes the assumption that money structs are created with that version of the library (which feels very fair); we are doing some oddness on our end.

That said, if it’s an easy win it’d help us out or a jam, of sorts!

kipcole9 commented 3 years ago

Thanks as always for the collaboration. It was an easy fix. Published ex_money version 5.5.1 with the following changelog entry:

Bug Fixes