mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 13:33:50 +12:00
09092cc051
Calling Api.load! to load an aggregate on an existing record, where the aggregated record has a relates_to_actor_via policy on it causes the following error. Note that this error was recently fixed when loading the aggregate as part of the query. 1) test relates to actor via has_many and with an aggregate (AshPostgres.AggregateTest) test/aggregate_test.exs:8 ** (RuntimeError) Could not determined related for `exists/2` expression. Context Resource: %{aggregates: %{}, calculations: %{}, data_layer: AshPostgres.DataLayer, public?: false, relationship_path: [], resource: AshPostgres.Test.Comment, root_resource: AshPostgres.Test.Comment} Context Relationship Path: [] At Path: [] Path: [:organization, :users] Related: nil Expression: exists(organization.users, [id: "df84db36-b8de-485b-8e47-a86307588f79"]) code: |> Api.load!(:count_of_comments, actor: user) stacktrace: (ash 2.5.13) lib/ash/filter/filter.ex:2121: Ash.Filter.add_expression_part/3 (ash 2.5.13) lib/ash/filter/filter.ex:2037: anonymous fn/3 in Ash.Filter.parse_expression/2 (elixir 1.14.2) lib/enum.ex:4751: Enumerable.List.reduce/3 (elixir 1.14.2) lib/enum.ex:2514: Enum.reduce_while/3 (ash 2.5.13) lib/ash/filter/filter.ex:295: Ash.Filter.parse/5 (ash 2.5.13) lib/ash/query/query.ex:1803: Ash.Query.do_filter/2 (elixir 1.14.2) lib/map.ex:883: Map.update!/3 (ash 2.5.13) lib/ash/engine/request.ex:654: Ash.Engine.Request.apply_filter/4 (ash 2.5.13) lib/ash/engine/request.ex:561: Ash.Engine.Request.do_strict_check/3 (ash 2.5.13) lib/ash/engine/request.ex:522: anonymous fn/2 in Ash.Engine.Request.strict_check/2 (elixir 1.14.2) lib/enum.ex:4751: Enumerable.List.reduce/3 (elixir 1.14.2) lib/enum.ex:2514: Enum.reduce_while/3 (ash 2.5.13) lib/ash/engine/request.ex:255: Ash.Engine.Request.do_next/1 (ash 2.5.13) lib/ash/engine/request.ex:211: Ash.Engine.Request.next/1 (ash 2.5.13) lib/ash/engine/engine.ex:650: Ash.Engine.advance_request/2 (ash 2.5.13) lib/ash/engine/engine.ex:556: Ash.Engine.fully_advance_request/2 (ash 2.5.13) lib/ash/engine/engine.ex:497: Ash.Engine.do_run_iteration/2 (elixir 1.14.2) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3 (ash 2.5.13) lib/ash/engine/engine.ex:440: Ash.Engine.run_iteration/1 (ash 2.5.13) lib/ash/engine/engine.ex:257: Ash.Engine.run_to_completion/1 (ash 2.5.13) lib/ash/engine/engine.ex:202: Ash.Engine.do_run/2 (ash 2.5.13) lib/ash/engine/engine.ex:141: Ash.Engine.run/2 (ash 2.5.13) lib/ash/actions/read.ex:170: Ash.Actions.Read.do_run/3 (ash 2.5.13) lib/ash/actions/read.ex:90: Ash.Actions.Read.run/3 (ash 2.5.13) lib/ash/api/api.ex:928: Ash.Api.load/4 (ash 2.5.13) lib/ash/api/api.ex:902: Ash.Api.load!/4 test/aggregate_test.exs:48: (test) |
||
---|---|---|
.. | ||
support | ||
aggregate_test.exs | ||
ash_postgres_test.exs | ||
calculation_test.exs | ||
constraint_test.exs | ||
custom_index_test.exs | ||
distinct_test.exs | ||
ecto_compatibility_test.exs | ||
embeddable_resource_test.exs | ||
enum_test.exs | ||
filter_test.exs | ||
load_test.exs | ||
manual_relationships_test.exs | ||
migration_generator_test.exs | ||
multitenancy_test.exs | ||
polymorphism_test.exs | ||
primary_key_test.exs | ||
schema_test.exs | ||
select_test.exs | ||
sort_test.exs | ||
test_helper.exs | ||
type_test.exs | ||
unique_identity_test.exs | ||
upsert_test.exs |