Money.Ecto.Map.Type (Money SQL v1.11.1)

View Source

Implements Ecto.Type behaviour for Money, where the underlying schema type is a map.

This is the required option for databases such as MySQL that do not support composite types.

In order to preserve precision, the amount is serialized as a string since the JSON representation of a numeric value is either an integer or a float.

Decimal.to_string/1 is not guaranteed to produce a string that will round-trip convert back to the identical number.

Summary

Functions

cast(money)

See Money.Ecto.Composite.Type.cast/1.

cast(money, params)

Callback implementation for Ecto.ParameterizedType.cast/2.

dump(money, dumper \\ nil, params \\ [])

Callback implementation for Ecto.ParameterizedType.dump/3.

embed_as(term)

See Money.Ecto.Composite.Type.embed_as/1.

equal?(term1, term2)

See Money.Ecto.Composite.Type.equal?/2.

init(params)

Callback implementation for Ecto.ParameterizedType.init/1.

load(money, loader \\ nil, params \\ [])

Callback implementation for Ecto.ParameterizedType.load/3.

type(params)

Callback implementation for Ecto.ParameterizedType.type/1.