Skip to content

Money SQL version 1.4.0

Compare
Choose a tag to compare
@kipcole9 kipcole9 released this 10 Feb 16:06
· 104 commits to master since this release

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.