fix: allow casting strings as uuids (for embedded types)

This commit is contained in:
Zach Daniel 2021-03-21 11:31:25 -04:00
parent ab31320e73
commit ac72c623d9

View file

@ -20,8 +20,11 @@ defmodule Ash.Type.UUID do
end
@impl true
def cast_stored(value, _) do
def cast_stored(value, constraints) do
Ecto.Type.load(Ecto.UUID, value)
rescue
_e in ArgumentError ->
cast_input(value, constraints)
end
@impl true