Skip to content

Commit

Permalink
Ready for release 1.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Dec 17, 2022
1 parent 33dbf82 commit d28bf8b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
16 changes: 10 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@

**When upgrading from `ex_money_sql` version `1.3.x` to `1.4.x` and later, please read the important migration information in the [README](/ex_money_sql/readme.html#migrating-from-money-sql-versions-1-3-or-earlier)**

**Note** That `money_sql` is supported on Elixir 1.11 and later only from ex_money_sql version 1.7.0.

## Money_SQL v1.7.3

This is the changelog for Money_SQL v1.7.3 released on December 18th, 2022.

## 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 v1.7.2

This is the changelog for Money_SQL v1.7.2 released on August 27th, 2022.

**Note** That `money_sql` is now supported on Elixir 1.11 and later only.

## Bug Fixes

* Makes the aggregate functions parallel-safe which provides up to 100% speed improvement. Thanks to @milangupta1 for the PR.
Expand All @@ -16,8 +24,6 @@ This is the changelog for Money_SQL v1.7.2 released on August 27th, 2022.

This is the changelog for Money_SQL v1.7.1 released on July 8th, 2022.

**Note** That `money_sql` is now supported on Elixir 1.11 and later only.

## Bug Fixes

* Fixes casting a money map when the currency is `nil`. Thanks to @frahugo for the report. Closes #24.
Expand All @@ -26,8 +32,6 @@ This is the changelog for Money_SQL v1.7.1 released on July 8th, 2022.

This is the changelog for Money_SQL v1.7.0 released on May 21st, 2022.

**Note** That `money_sql` is now supported on Elixir 1.11 and later only.

## Enhancements

* Adds the module `Money.Validation` to provide [Ecto Changeset validations](https://hexdocs.pm/ecto/Ecto.Changeset.html#module-validations-and-constraints). In particular it adds `Money.Validation.validate_money/3` which behaves exactly like `Ecto.Changeset.validate_number/3` only for `t:Money.t/0` types.
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Money.Sql.Mixfile do
use Mix.Project

@version "1.7.2"
@version "1.7.3"

def project do
[
Expand Down
12 changes: 12 additions & 0 deletions test/money_ecto_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ defmodule Money.Ecto.Test do
assert Money.Ecto.Map.Type.dump(Money.new(:USD, 100)) ==
{:ok, %{"amount" => "100", "currency" => "USD"}}
end

test "dump and loade a money struct when the locale uses non-default separators" do
Cldr.with_locale("de", Test.Cldr, fn ->
money = Money.new(:USD, "100,34")
dumped = Money.Ecto.Map.Type.dump(money)
assert dumped == {:ok, %{"amount" => "100.34", "currency" => "USD"}}

cast = Money.Ecto.Map.Type.load(elem(dumped, 1))
assert cast == {:ok, money}
end)
end

end

for ecto_type_module <- [Money.Ecto.Composite.Type, Money.Ecto.Map.Type] do
Expand Down

0 comments on commit d28bf8b

Please sign in to comment.