File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1323,4 +1323,26 @@ defmodule AshPostgres.FilterTest do
13231323 assert id2 == post_false . id
13241324 end
13251325 end
1326+
1327+ describe "intersects/2 with mismatched array types" do
1328+ test "uuid array intersects with text array" do
1329+ post =
1330+ Post
1331+ |> Ash.Changeset . for_create ( :create , % { title: "post with comments" } )
1332+ |> Ash . create! ( )
1333+
1334+ comment =
1335+ Comment
1336+ |> Ash.Changeset . for_create ( :create , % { title: "comment1" } )
1337+ |> Ash.Changeset . manage_relationship ( :post , post , type: :append_and_remove )
1338+ |> Ash . create! ( )
1339+
1340+ comment_id_as_string = to_string ( comment . id )
1341+
1342+ assert [ % Post { } ] =
1343+ Post
1344+ |> Ash.Query . filter ( intersects ( comment_ids , [ ^ comment_id_as_string ] ) )
1345+ |> Ash . read! ( )
1346+ end
1347+ end
13261348end
Original file line number Diff line number Diff line change @@ -1335,6 +1335,8 @@ defmodule AshPostgres.Test.Post do
13351335 sort ( title: :asc_nils_last )
13361336 end
13371337
1338+ list ( :comment_ids , :comments , :id )
1339+
13381340 sum :total_edited_time , :comments , :edited_duration do
13391341 filter ( expr ( version == :edited ) )
13401342 public? ( true )
You can’t perform that action at this time.
0 commit comments