test: update non-simple-equality manual relationship tests

This commit is contained in:
Zach Daniel 2024-07-01 17:32:32 -04:00
parent 6bf4945228
commit d53ad508cd
4 changed files with 8 additions and 1 deletions

View file

@ -34,4 +34,9 @@ if Mix.env() == :test do
config :ash, :validate_domain_resource_inclusion?, false
config :ash, :validate_domain_config_inclusion?, false
config :ash, :policies, show_policy_breakdowns?: true
config :ash, :compatible_foreign_key_types,
[
{Ash.Type.CiString, Ash.Type.UUID}
]
end

View file

@ -26,6 +26,7 @@ defmodule Ash.Type.UUID do
@impl true
def cast_input(nil, _), do: {:ok, nil}
def cast_input(%Ash.CiString{string: string}, constraints), do: cast_input(string, constraints)
def cast_input(value, _) when is_binary(value) do
case String.valid?(value) do
true -> Ecto.Type.cast(Ecto.UUID, String.trim(value))

View file

@ -24,6 +24,7 @@ defmodule Ash.Type.UUIDv7 do
end
@impl true
def cast_input(%Ash.CiString{string: string}, constraints), do: cast_input(string, constraints)
def cast_input(nil, _), do: {:ok, nil}
def cast_input(

View file

@ -86,7 +86,7 @@ defmodule Ash.Test.Actions.HasManyTest do
end
attributes do
uuid_primary_key :id, type: :uuid_v7
uuid_primary_key :id, type: :ci_string
attribute :title, :string do
public?(true)