Actor attribute in relationship filter expression is NULL

I have an Actor Resource that has a project_id attribute and it has been used successfully in policies many times. But for some reason in this relationship it is always NULL:
has_many :users, Auth.User do
filter expr(^actor(:project_id) == project_id)
end
has_many :users, Auth.User do
filter expr(^actor(:project_id) == project_id)
end
This is the query where:
WHERE (NULL::bigint = u0."project_id"::bigint::bigint)
WHERE (NULL::bigint = u0."project_id"::bigint::bigint)
Does the ^actor template not work the same in relationship and policies expressions?
Solution:
Can I see the code where you're doing that? Are you specifying the actor theere?
Jump to solution
4 Replies
ZachDaniel
ZachDaniel5mo ago
They do, how are you getting there? Loading the relationship?
Ahrou
AhrouOP5mo ago
Yes was loading the relationship
Solution
ZachDaniel
ZachDaniel5mo ago
Can I see the code where you're doing that? Are you specifying the actor theere?
Ahrou
AhrouOP5mo ago
You're right i am missing the actor there 🤦‍♂️ this is in the auth domain which we havent touched in a while so it is not required. thanks for the help 🙏

Did you find this page helpful?