Filtering by an embedded array attribute's resource value?
I can write a filter that filters by an attribute of an embedded resource using
But this doesn't seem to work if the embedded attribute is an array of resources.
eg. resource
has an attribute ->
and I want to select Ingredients if any of their effects matches a filter.
get_path, eg.But this doesn't seem to work if the embedded attribute is an array of resources.
eg. resource
Ingredienthas an attribute ->
attribute :effects, {:array, __MODULE__.Effect}, allow_nil?: false, default: []and I want to select Ingredients if any of their effects matches a filter.
exists was my first thought but that only works for relationships (or plain resources), not attributes?
Ash