mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 05:23:03 +12:00
fix: allow casting strings as uuids (for embedded types)
This commit is contained in:
parent
ab31320e73
commit
ac72c623d9
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue