diff --git a/lib/aggregate.ex b/lib/aggregate.ex index f9f9c35..6373044 100644 --- a/lib/aggregate.ex +++ b/lib/aggregate.ex @@ -791,7 +791,7 @@ defmodule AshPostgres.Aggregate do """ rel -> - to_many_path?(rel.destination, [rest]) + to_many_path?(rel.destination, rest) end end diff --git a/test/aggregate_test.exs b/test/aggregate_test.exs index 7494511..326945b 100644 --- a/test/aggregate_test.exs +++ b/test/aggregate_test.exs @@ -1167,12 +1167,8 @@ defmodule AshPostgres.AggregateTest do test "a count can filter independently of the query" do Post |> Api.aggregate([ - Ash.Query.Aggregate.new!(Post, :count, :count, - query: [filter: Ash.Expr.expr(comments.likes > 10)] - ), - Ash.Query.Aggregate.new!(Post, :count2, :count, - query: [filter: Ash.Expr.expr(comments.likes < 10)] - ) + {:count, :count, query: [filter: Ash.Expr.expr(comments.likes > 10)]}, + {:count2, :count, query: [filter: Ash.Expr.expr(comments.likes < 10)]} ]) end