From b5b1077032bd178572b7387006cef18da2afb8d4 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Tue, 20 Feb 2024 22:13:23 -0500 Subject: [PATCH] chore: fix recursion error in to_many_path? --- lib/aggregate.ex | 2 +- test/aggregate_test.exs | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) 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