chore: fix recursion error in to_many_path?

This commit is contained in:
Zach Daniel 2024-02-20 22:13:23 -05:00
parent 38d1beb0d8
commit b5b1077032
2 changed files with 3 additions and 7 deletions

View file

@ -791,7 +791,7 @@ defmodule AshPostgres.Aggregate do
""" """
rel -> rel ->
to_many_path?(rel.destination, [rest]) to_many_path?(rel.destination, rest)
end end
end end

View file

@ -1167,12 +1167,8 @@ defmodule AshPostgres.AggregateTest do
test "a count can filter independently of the query" do test "a count can filter independently of the query" do
Post Post
|> Api.aggregate([ |> Api.aggregate([
Ash.Query.Aggregate.new!(Post, :count, :count, {:count, :count, query: [filter: Ash.Expr.expr(comments.likes > 10)]},
query: [filter: Ash.Expr.expr(comments.likes > 10)] {:count2, :count, query: [filter: Ash.Expr.expr(comments.likes < 10)]}
),
Ash.Query.Aggregate.new!(Post, :count2, :count,
query: [filter: Ash.Expr.expr(comments.likes < 10)]
)
]) ])
end end