You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test filter with ref (AshPostgres.FilterTest)
test/filter_test.exs:1076
** (FunctionClauseError) no function clause matching in Ash.Filter.check_filterable/2
The following arguments were given to Ash.Filter.check_filterable/2:
Describe the bug
Filtering on a ref was working up until Ash 3.0. Now, it gives an error.
To Reproduce
A PR with a failing test has been added to demonstrate the error. Running the test give the following error:
test filter with ref (AshPostgres.FilterTest)
test/filter_test.exs:1076
** (FunctionClauseError) no function clause matching in Ash.Filter.check_filterable/2
The following arguments were given to Ash.Filter.check_filterable/2:
Attempted function clauses (showing 2 out of 2):
code: |> Ash.Query.filter(^ref(:id, [:posts, :comments]) == ^comment.id)
stacktrace:
(ash 3.0.1) lib/ash/filter/filter.ex:2944: Ash.Filter.check_filterable/2
(ash 3.0.1) lib/ash/filter/filter.ex:2933: anonymous fn/2 in Ash.Filter.validate_filterable_relationship_paths/2
(elixir 1.16.2) lib/enum.ex:4316: Enum.find_value_list/3
(ash 3.0.1) lib/ash/filter/filter.ex:2923: Ash.Filter.validate_refs/3
(ash 3.0.1) lib/ash/filter/filter.ex:3015: Ash.Filter.resolve_call/2
(ash 3.0.1) lib/ash/filter/filter.ex:2489: Ash.Filter.add_expression_part/3
(ash 3.0.1) lib/ash/filter/filter.ex:2427: anonymous fn/3 in Ash.Filter.parse_expression/2
(elixir 1.16.2) lib/enum.ex:4839: Enumerable.List.reduce/3
(elixir 1.16.2) lib/enum.ex:2582: Enum.reduce_while/3
(ash 3.0.1) lib/ash/filter/filter.ex:334: Ash.Filter.parse/3
(ash 3.0.1) lib/ash/query/query.ex:2574: Ash.Query.do_filter/3
test/filter_test.exs:1095: (test)
The text was updated successfully, but these errors were encountered: