fix: don't use fragment("1") because ecto requires a proper source

This commit is contained in:
Zach Daniel 2024-05-07 20:01:29 -04:00
parent 991510b87f
commit 69d8a732f0
2 changed files with 4 additions and 5 deletions

View file

@ -1561,7 +1561,7 @@ defmodule AshPostgres.Expr do
on_subquery: fn subquery ->
subquery =
Ecto.Query.from(row in Ecto.Query.exclude(subquery, :select),
select: fragment("1")
select: row
)
|> Map.put(:__ash_bindings__, subquery.__ash_bindings__)

View file

@ -16,10 +16,9 @@ defmodule AshPostgres.Test.ManualRelationshipsTest do
end
test "exists can be used" do
post =
Post
|> Ash.Changeset.new(%{title: "title"})
|> Api.create!()
Post
|> Ash.Changeset.new(%{title: "title"})
|> Api.create!()
Comment
|> Ash.Changeset.new(%{title: "title2"})