Skip to content

Commit 5ba0965

Browse files
committed
fix: exclude :calculations from subquery select in wrap_in_subquery_for_aggregates
1 parent 4f23769 commit 5ba0965

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/calculation.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ defmodule AshSql.Calculation do
212212
end
213213

214214
query = Ecto.Query.select_merge(query, ^calcs)
215-
put_in(query.__ash_bindings__[:select_calculations], Map.keys(calcs))
215+
select_calculations = Map.keys(calcs) |> Enum.reject(&(&1 == :calculations))
216+
put_in(query.__ash_bindings__[:select_calculations], select_calculations)
216217
end
217218
end

0 commit comments

Comments
 (0)