Skip to content

Releases: kipcole9/money_sql

Money SQL version 1.6.0

30 Dec 22:23
Compare
Choose a tag to compare

Enhancements

  • t:Money.Ecto.Composite.Type and t:Money.Ecto.Map.Type now return the exception module when there is an error in cast/1. For example:
iex> Money.Ecto.Composite.Type.cast("") ==
{:error,
 [
   exception: Money.InvalidAmountError,
   message: "Amount cannot be converted to a number: \"\""
 ]}

The expected exceptions are:

  • Money.InvalidAmountError
  • Money.UnknownCurrencyError
  • Money.ParseError

Thanks to @DaTrader for the enhancement request.

Money SQL version 1.5.2

12 Dec 19:55
Compare
Choose a tag to compare

Bug Fixes

  • Fixes c:Ecto.ParameterizedType.embed_as/2 callback for the Ecto.ParameterizedType behaviour. Thanks to @nseantanly for the report and the PR.

Money SQL version 1.5.1

08 Dec 05:21
Compare
Choose a tag to compare

Bug Fixes

  • Implements c:Ecto.ParameterizedType.equal?/3 callback for the Ecto.ParameterizedType behaviour. Thanks to @namhoangyojee for the report and the PR.

  • Adds @impl Ecto.ParameterizedType to the relevant callbacks.

Money SQL version 1.5.0

24 Sep 23:55
Compare
Choose a tag to compare

Enhancements

  • Adds a + operator for the Postgres type :money_with_currency

  • The name of the migration to create the :money_with_currency type has shortened to be money.gen.postgres.money_with_currency

Money SQL version 1.4.4

18 Mar 01:00
Compare
Choose a tag to compare

Bug Fixes

  • Don't use is_struct/1 guard to support compatibility on older Elixir releases

Money SQL version 1.4.3

17 Feb 05:31
Compare
Choose a tag to compare

Bug Fixes

  • Don't propogate a :default option into the t:Money from the schema. Fixes #14. Thanks to @emaiax.

Money SQL version 1.4.2

11 Feb 22:50
Compare
Choose a tag to compare

Bug Fixes

  • Dumping/loading nil returns {:ok, nil}. Thanks to @morinap.

Money SQL version 1.4.1

10 Feb 21:57
Compare
Choose a tag to compare

Bug Fixes

  • Casting nil returns {:ok, nil}. Thanks to @morinap.

Money SQL version 1.4.0

10 Feb 16:06
Compare
Choose a tag to compare

Bug Fixes

  • Fix parsing error handling in Money.Ecto.Composite.Type.cast/2. Thanks to @NikitaAvvakumov. Closes #10.

  • Fix casting localized amounts. Thanks to @olivermt. Closes #11.

Enhancements

  • Changes Money.Ecto.Composite.Type and Money.Ecto.Map.Type to be ParameterizedType. As a result, Ecto 3.5 or later is required. This change allows configuration of format options for the :money_with_currency to added as parameters in the Ecto schema. For the example schema:
defmodule Organization do
  use Ecto.Schema

  @primary_key false
  schema "organizations" do
    field :payroll,         Money.Ecto.Composite.Type
    field :tax,             Money.Ecto.Composite.Type, fractional_digits: 4
    field :name,            :string
    field :employee_count,  :integer
    timestamps()
  end
end

The field :tax will be instantiated as a Money.t with :format_options of fractional_digits: 4.

Money SQL version 1.3.1

30 Sep 01:09
Compare
Choose a tag to compare

Bug Fixes

  • Fixes compatibility with both Decimal version 1.x and 2.x. Thanks to @doughsay and @coladarci for the report. Closes #8.