parse filter with fields from another resource relationship
I'm using
Ash.Filter.parse/2
to generate filters using the list syntax, for example:
Now, let's say that my Template
resource has relationship with another resource School
and I want to do a filter expression like this: school.name == "bla"
I'm not sure how to express that I'm accessing the name
field inside the school
relationship field.
I tried something like this:
But this doesn't work, and at the same time I can't find examples with relationships in the documentation.1 Reply
Ha!, I was taking a look into the unit tests and found this one that showed how to do it: https://github.com/ash-project/ash/blob/452ec7df9d40a302206384e5b4c580a02d2c1860/test/filter/filter_test.exs#L595
For reference, the above query can be written like this: