It seems the Ecto.Type's load callback is not invoked, when I insert or update an record with integer or string type instead of atom, the result of Repo.insert!/1 or Repo.update/1 would be integer/string instead of atom.
defenum MyApp.Status,
pending: 0
defmodule MyApp.Order do
field :status, OrderStatus, default: :pending
end
order = Repo.insert! %Order{status: 0}
IO.inspect order.status # => 0
It seems the
Ecto.Type
'sload
callback is not invoked, when I insert or update an record with integer or string type instead of atom, the result of Repo.insert!/1 or Repo.update/1 would be integer/string instead of atom.I am using
ecto
1.1.1 andecto_enum
0.3.0.