Skip to content

Commit

Permalink
fix: temporarily omit overzealous validation
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Oct 19, 2023
1 parent 7d06d8f commit cb8fc29
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions lib/ash/filter/filter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1863,17 +1863,21 @@ defmodule Ash.Filter do
|> Enum.find(fn path ->
not to_one_path?(path, resource)
end)
|> case do
nil ->
:ok

path ->
raise """
Only to-one relationship references are allowed in a calculation reference paths. Got: #{inspect(Enum.join(path, "."))} in #{inspect(ref)}
# This validation needs to be added back in at some point
# it was removed because we currently can't tell the difference between relationship paths
# that appear inside of the path to `exists`, i.e `exists(to_many, ....)`.
# |> case do
# nil ->
# :ok

To extract a single value from a to_many relationship or path that includes a to_many relationship, use a `first` aggregate.
"""
end
# path ->
# raise """
# Only to-one relationship references are allowed in a calculation reference paths. Got: #{inspect(Enum.join(path, "."))} in #{inspect(ref)}

# To extract a single value from a to_many relationship or path that includes a to_many relationship, use a `first` aggregate.
# """
# end

nested =
Enum.map(nested, fn
Expand Down

0 comments on commit cb8fc29

Please sign in to comment.