Does order matter in filtering resources?

This seems to be returning all buys and not filtering by user_id == user.id.
Resource
|> Ash.Query.for_read(:buys)
|> Ash.Query.filter(user_id == user.id)
|> Api.read()
Resource
|> Ash.Query.for_read(:buys)
|> Ash.Query.filter(user_id == user.id)
|> Api.read()
2 Replies
ZachDaniel
ZachDaniel3y ago
You want ^user.id That is filtering for all users where user_id equals the associated user’s id. Which is all users 🙂
dj_goku
dj_gokuOP3y ago
FUBAR! UGH Thank you! Well now all my tests pass!

Did you find this page helpful?