Money v1.0.0-beta Money.Ecto.Type
Provides a type for Ecto usage. The underlying data type should be an integer.
This type expects you to use a single currency. The currency must be defined in your configuration.
config :money,
default_currency: :GBP
Migration Example
create table(:my_table) do
add :amount, :integer
end
Schema Example
schema "my_table" do
field :amount, Money.Ecto.Type
end
Summary
Functions
Callback implementation for c:Ecto.Type.cast/1
.
Specs
dump(integer | Money.t) :: {:ok, :integer}
Callback implementation for c:Ecto.Type.dump/1
.