mirror of
https://github.com/ash-project/ash.git
synced 2024-09-19 13:03:02 +12:00
test: update non-simple-equality manual relationship tests
This commit is contained in:
parent
6bf4945228
commit
d53ad508cd
4 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue