How to use relationship id in a `get_by` read action
My resource has this relationship:
This means that this resource table will contain a
:customer_id
field.
Now I want to create a read action that will filter it by the :customer_id
. I can do that by passing that as an argument and doing the filter manually, but I expected that I could use the get_by
shortcut here, like this:
The problem is that this fails with Ash saying that there is not attribute, calculation or aggregate with that name.2 Replies
That may be a bug in that validator
Can you open an issue on ash?
In the meantime, make it
get? true
and add the argument/filter yourself should do itGitHub
bug: read action get_by don't recognize relationship attributes · I...
Describe the bug If you have a relationship in your resource, for example with belongs_to, get_by shortcut for a read action will not find the correspondent relationship id attribute. To Reproduce ...