Open oyeanuj opened 7 years ago
Is making a change "on the radar"? Considering you're the first to ask for it, probably not yet, though third-party PRs are always welcome of course. But:
union
?In the other thread you mentioned your scopes have eager loading. Without seeing your application, my intuition is that placing includes
etc. in a scope is premature. In any case you should be able to write:
relation_1.union(relation_2).includes(...)
I haven't done Rails work in a while so I don't remember specifically, but I think the above should work.
@brianhempel Thank you for the quick response!
I'm following your suggestion in places where I can, where simple relations are being used. However, unfortunately, in my code, a lot of the associations come via multiple different models (scopes were just one example), and hence moving includes
away means changing a lot of code at a lot of places.
I understand that it might not be worth the effort based on a single use-case, but hope it starts the discussion.
Hi @brianhempel @glebm! I am coming from the Readme where you asked folks to make a noise around supporting 'eager-loading'. Is that still on the radar? In my case, almost all scopes have eager-loading and includes, joins and references, and I'd love to clean up my code using this!
FWIW, testing it so far, I keep getting the following error.
Thank you for putting out this library!