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
.