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
Consider adding additional filters that allow filtering on relationship attributes and association object patterns. Happy to make a PR based off the examples given here.
I've had a couple brief discussions about this with @cofin, so I'm making this as a feature request so we're not cluttering up the discord with it.
Basic Example
A RelationshipFilter could be relatively simple (with some smarter logic, it could even be integrated into an existing filter - though being explicit may be preferable so users are always aware they're working with relationships. I have been using this example for my relationships:
And this example for Association Object patterns. There's likely a world where these two filters can be combined, but again being explicit is probably preferable.
These open up another route to hitting relationship join method issues (e.g. these will currently error out on a "noload" relationship, and of course a "raiseload" relationship). They should probably check the join status in the current object, particularly since they'll often be used in async contexts where lazy loading is a no-go.
The examples posted are also probably in need of some optimisation.
Unresolved questions
No response
The text was updated successfully, but these errors were encountered:
Summary
Consider adding additional filters that allow filtering on relationship attributes and association object patterns. Happy to make a PR based off the examples given here.
I've had a couple brief discussions about this with @cofin, so I'm making this as a feature request so we're not cluttering up the discord with it.
Basic Example
A RelationshipFilter could be relatively simple (with some smarter logic, it could even be integrated into an existing filter - though being explicit may be preferable so users are always aware they're working with relationships. I have been using this example for my relationships:
And this example for Association Object patterns. There's likely a world where these two filters can be combined, but again being explicit is probably preferable.
Drawbacks and Impact
These open up another route to hitting relationship join method issues (e.g. these will currently error out on a "noload" relationship, and of course a "raiseload" relationship). They should probably check the join status in the current object, particularly since they'll often be used in async contexts where lazy loading is a no-go.
The examples posted are also probably in need of some optimisation.
Unresolved questions
No response
The text was updated successfully, but these errors were encountered: