View Source Money.Ecto.Type (Money v1.13.1)
WARNING: This module is deprecated. Use Money.Ecto.Amount.Type
module instead.
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 Ecto.Type.cast/1
.
Callback implementation for Ecto.Type.dump/1
.
Callback implementation for Ecto.Type.embed_as/1
.
Callback implementation for Ecto.Type.equal?/2
.
Callback implementation for Ecto.Type.load/1
.
Callback implementation for Ecto.Type.type/0
.
Functions
Callback implementation for Ecto.Type.cast/1
.
Callback implementation for Ecto.Type.dump/1
.
Callback implementation for Ecto.Type.embed_as/1
.
Callback implementation for Ecto.Type.equal?/2
.
Callback implementation for Ecto.Type.load/1
.
@spec type() :: :integer
Callback implementation for Ecto.Type.type/0
.