mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 05:23:18 +12:00
parent
cef3d20eaf
commit
33bd0a7061
1 changed files with 8 additions and 1 deletions
|
@ -94,10 +94,17 @@ defmodule AshPostgres.Aggregate do
|
|||
is_single? && Enum.at(aggregates, 0).kind == :exists ->
|
||||
[aggregate] = aggregates
|
||||
|
||||
expr =
|
||||
if is_nil(Map.get(aggregate.query, :filter)) do
|
||||
true
|
||||
else
|
||||
Map.get(aggregate.query, :filter)
|
||||
end
|
||||
|
||||
exists =
|
||||
AshPostgres.Expr.dynamic_expr(
|
||||
query,
|
||||
%Ash.Query.Exists{path: aggregate.relationship_path, expr: true},
|
||||
%Ash.Query.Exists{path: aggregate.relationship_path, expr: expr},
|
||||
query.__ash_bindings__
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue