improvement: trim whitespace in uuid

This commit is contained in:
Zach Daniel 2021-03-18 23:32:56 -04:00
parent ba6b4202f9
commit 0ef51ce9e6

View file

@ -11,6 +11,10 @@ defmodule Ash.Type.UUID do
def storage_type, do: :binary_id
@impl true
def cast_input(value, _) when is_binary(value) do
Ecto.Type.cast(:binary_id, String.trim(value))
end
def cast_input(value, _) do
Ecto.Type.cast(:binary_id, value)
end