We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee5a06a commit 4077cf8Copy full SHA for 4077cf8
lib/aggregate.ex
@@ -2562,17 +2562,15 @@ defmodule AshSql.Aggregate do
2562
)
2563
2564
2565
- bindings_without_aggregates =
2566
- query.__ash_bindings__.bindings
2567
- |> Enum.reject(fn
2568
- {_binding, %{type: :aggregate}} -> true
2569
- _ -> false
2570
- end)
2571
- |> Map.new()
+ root_binding = query.__ash_bindings__.root_binding
+
+ only_root_binding = %{
+ root_binding => query.__ash_bindings__.bindings[root_binding]
+ }
2572
2573
new_bindings =
2574
query.__ash_bindings__
2575
- |> Map.put(:bindings, bindings_without_aggregates)
+ |> Map.put(:bindings, only_root_binding)
2576
|> Map.delete(:__order__?)
2577
2578
Map.put(subquery_query, :__ash_bindings__, new_bindings)
0 commit comments