View Source Money.Ecto.Map.Type (Money SQL v1.11.0)
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
Callback implementation for Ecto.ParameterizedType.cast/2
.
Callback implementation for Ecto.ParameterizedType.dump/3
.
See Money.Ecto.Composite.Type.embed_as/1
.
Callback implementation for Ecto.ParameterizedType.init/1
.
Callback implementation for Ecto.ParameterizedType.load/3
.
Callback implementation for Ecto.ParameterizedType.type/1
.
Functions
Callback implementation for Ecto.ParameterizedType.cast/2
.
Callback implementation for Ecto.ParameterizedType.dump/3
.
See Money.Ecto.Composite.Type.embed_as/1
.
Callback implementation for Ecto.ParameterizedType.init/1
.
Callback implementation for Ecto.ParameterizedType.load/3
.
Callback implementation for Ecto.ParameterizedType.type/1
.