remove Logger config and enable aggregates in validation again

This commit is contained in:
Barnabas Jovanovics 2024-07-23 10:00:52 +02:00
parent 0a6f890907
commit 9e4efa7b9b
2 changed files with 3 additions and 5 deletions

View file

@ -304,8 +304,6 @@ defmodule AshPostgres.AtomicsTest do
|> Ash.Changeset.for_create(:create, %{post_id: post.id, title: "foo"}) |> Ash.Changeset.for_create(:create, %{post_id: post.id, title: "foo"})
|> Ash.create!() |> Ash.create!()
Logger.configure(level: :debug)
assert_raise Ash.Error.Invalid, ~r/Can only delete if Post has no comments/, fn -> assert_raise Ash.Error.Invalid, ~r/Can only delete if Post has no comments/, fn ->
post post
|> Ash.Changeset.for_update(:update_if_no_comments, %{title: "bar"}) |> Ash.Changeset.for_update(:update_if_no_comments, %{title: "bar"})

View file

@ -22,9 +22,9 @@ defmodule HasNoComments do
[ [
{:atomic, [], {:atomic, [],
expr( expr(
# length(list(comments, field: :id)) > 0 or length(list(comments, field: :id)) > 0 or
# count(comments) > 0 or count(comments) > 0 or
exists(comments, true) exists(comments, true)
), ),
expr( expr(
error(^Ash.Error.Changes.InvalidChanges, %{ error(^Ash.Error.Changes.InvalidChanges, %{