Skip to content

Commit

Permalink
Update lib/ecto/soft_delete_repo.ex
Browse files Browse the repository at this point in the history
Don’t throw away other possible subquery context.

Co-authored-by: Jason Pollentier <[email protected]>
  • Loading branch information
LeakyBucket and grossvogel authored Nov 2, 2024
1 parent 35f3761 commit 5fe190c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ecto/soft_delete_repo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ defmodule Ecto.SoftDelete.Repo do

defp filter_soft_deleted(%Ecto.SubQuery{query: query} = sub) do
if Ecto.SoftDelete.Query.soft_deletable?(query) do
from(x in query, where: is_nil(x.deleted_at)) |> subquery()
%{sub | query: from(x in query, where: is_nil(x.deleted_at))}
else
sub
end
Expand Down

0 comments on commit 5fe190c

Please sign in to comment.