Skip to content

Commit 87617f8

Browse files
committed
improvement: support new cast_in_query?/2
1 parent 301466e commit 87617f8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/types/types.ex

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ defmodule AshPostgres.Types do
2323

2424
def parameterized_type(type, constraints) do
2525
if Ash.Type.ash_type?(type) do
26-
if Ash.Type.cast_in_query?(type) do
26+
cast_in_query? =
27+
if function_exported?(Ash.Type, :cast_in_query?, 2) do
28+
Ash.Type.cast_in_query?(type, constraints)
29+
else
30+
Ash.Type.cast_in_query?(type)
31+
end
32+
33+
if cast_in_query? do
2734
parameterized_type(Ash.Type.ecto_type(type), constraints)
2835
else
2936
nil

0 commit comments

Comments
 (0)