You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now aggregates (exists, max, count and so on) in expressions (expr) work only with relationships expr(exists(friends, name == "John")). It would be handy in some cases to have ability to specify aggregates using resources as targets - expr(exists(User, name == "John")).
Recent case where I've encountered it is about create policies as they do not have relationships setup yet. I can use simple check but expression one would have been shorter and cleaner.
I've seen hacks with declaring a has_many relationship with no_attributes?: true and then using that relationship as target for aggregates but would prefer for it to be supported officially so to speak.
The text was updated successfully, but these errors were encountered:
I'm a fan of this proposal, but it will be a pretty significant change, as all aggregates are currently expecting to be at some relationship path to the resource. Its definitely doable, and should be doable without being a breaking change for users though.
Right now aggregates (
exists
,max
,count
and so on) in expressions (expr
) work only with relationshipsexpr(exists(friends, name == "John"))
. It would be handy in some cases to have ability to specify aggregates using resources as targets -expr(exists(User, name == "John"))
.Recent case where I've encountered it is about create policies as they do not have relationships setup yet. I can use simple check but expression one would have been shorter and cleaner.
I've seen hacks with declaring a
has_many
relationship withno_attributes?: true
and then using that relationship as target for aggregates but would prefer for it to be supported officially so to speak.The text was updated successfully, but these errors were encountered: