Skip to content

Releases: kipcole9/money_sql

Money SQL version 1.11.0

24 Jan 00:31
Compare
Choose a tag to compare

Enhancements

  • When dumping a Money.Ecto.Composite.Type, detect if dump/3 is being called by Ecto.Type.embedded_dump/2. If it is, then return a map that can be serialized to JSON. If it isn't (most cases) then return the tuple to be serialized to Postgres. See papertrail issue.

Money SQL version 1.10.1

02 Nov 21:55
Compare
Choose a tag to compare

Bug Fixes

  • Fix compilation warnings on Elixir 1.16.

  • Fix migration generator for money_with_currency type. Thanks to @bigardone for the issue and PR. Closes #37, closes #38.

Money SQL version 1.10.0

30 Oct 04:12
Compare
Choose a tag to compare

Bug Fixes

  • The mix tasks that generate database function migrations (money.gen.postgres.sum_function, money.gen.postgres.plus_operator and money.gen.postgres.min_max_functions) need to be aware of the type of the money_with_currency "amount" element in a Postgres database. In releases of ex_money_sql up to 1.7.1 the type was char(3). In later releases is changed to the more canonical varchar. In turn, the database functions need to know the type for the internal accumulator. It is possible, as illustrated in issue #36, to have generated the money_with_currency type as char(3) and then move to a later release of ex_money_sql. In which case the money database function migrations would fail because they were built with varchar accumulators. This release will detect the underlying type of the money_with_currency "amount" element and adjust the migration accordingly. Thanks to @bigardone for the report and motivation to get this done. Closes #36.

Enhancements

  • Adds database functions for unary negation and the operation -. Thanks to @zachdaniel for the PR.

Money SQL version 1.9.3

01 Oct 02:50
Compare
Choose a tag to compare

Bug Fixes

  • Return an error is loading invalid amounts such as Inf and NaN. Thanks to @dhedlund for the report and PR. Closes #34.

Money SQL version 1.9.2

12 Jul 01:09
Compare
Choose a tag to compare

Embedded Schema Configuration

Please ensure that if you are using Ecto embedded schemas that include a money type that it is configured with the type Money.Ecto.Map.Type, NOT Money.Ecto.Composite.Type.

In previous releases the misconfiguration of the type worked by accident. In this release and subsequent releases you will likely see an exception like ** (Protocol.UndefinedError) protocol Jason.Encoder not implemented for {"USD", Decimal.new("50.00")} of type Tuple. This is most likely an indication of type misconfiguration in an embedded schema.

Bug Fixes

  • Fixes dumping and loading of Money.Ecto.Map.Type when used in embedded schemas. Many thanks to @redrabbit for the issue and the PR. Closes #32.

Money SQL version 1.9.1

12 May 11:51
Compare
Choose a tag to compare

Bug Fixes

  • Fixes casting a map when the "amount" is nil. Thanks to @treere for the report and PR. Closes #30.

Cldr Money SQL version 1.9.0

28 Apr 04:59
Compare
Choose a tag to compare

Enhancements

  • Adds Money.Ecto.Query.API query helpers to simplify Ecto queries involving money columns. Thanks very much to @am-kantox for the excellent suggestion and PR.

Money SQL version 1.7.3

17 Dec 17:10
Compare
Choose a tag to compare

Bug Fixes

  • When loading money from the database with the Money.Ecto.Map.Type type, do not do localized parsing of the amount. The amount is always saved using Decimal.to_string/1 and therefore is not localized. It must not be parsed with localization on loading.

Money SQL version 1.7.2

26 Aug 21:02
Compare
Choose a tag to compare

Bug Fixes

  • Makes the aggregate functions parallel-safe which provides up to 100% speed improvement. Thanks to @milangupta1 for the PR.

Money SQL version 1.7.1

07 Jul 22:54
Compare
Choose a tag to compare

Bug Fixes

  • Fixes casting a money map when the currency is nil. Thanks to @frahugo for the report. Closes #24.