View Source Money.Ecto.Currency.Type (Money v1.13.1)
Provides a type for Ecto to store a currency. The underlying data type is a string.
Migration
create table(:my_table) do
add :currency, :varchar, size: 3
end
Schema
schema "my_table" do
field :currency, Money.Ecto.Currency.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() :: :string
Callback implementation for Ecto.Type.type/0
.