Releases: kipcole9/money_sql
Releases · kipcole9/money_sql
Money SQL version 1.6.0
Enhancements
t:Money.Ecto.Composite.Type
andt:Money.Ecto.Map.Type
now return the exception module when there is an error incast/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
Bug Fixes
- Fixes
c:Ecto.ParameterizedType.embed_as/2
callback for theEcto.ParameterizedType
behaviour. Thanks to @nseantanly for the report and the PR.
Money SQL version 1.5.1
Bug Fixes
-
Implements
c:Ecto.ParameterizedType.equal?/3
callback for theEcto.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
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 bemoney.gen.postgres.money_with_currency
Money SQL version 1.4.4
Bug Fixes
- Don't use
is_struct/1
guard to support compatibility on older Elixir releases
Money SQL version 1.4.3
Money SQL version 1.4.2
Bug Fixes
- Dumping/loading
nil
returns{:ok, nil}
. Thanks to @morinap.
Money SQL version 1.4.1
Bug Fixes
- Casting
nil
returns{:ok, nil}
. Thanks to @morinap.
Money SQL version 1.4.0
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
andMoney.Ecto.Map.Type
to beParameterizedType
. 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
Bug Fixes
- Fixes compatibility with both
Decimal
version1.x
and2.x
. Thanks to @doughsay and @coladarci for the report. Closes #8.