is really convenient, but it will return all messages for all conversations, even when they are not needed to display a overview of available conversations.
The autoFetch will only include the associations given. If autoFetch is set to true, then just fetch all associations. If it is an array, only fetch the ones specified.
autoFetch
is a really cool feature. But it can prove to be unpractical when returning far too much data, that is actually not needed.Imagine having users and messages grouped into conversations with other participating users. Writing
is really convenient, but it will return all messages for all conversations, even when they are not needed to display a overview of available conversations.
I would like to propose the following syntax:
The
autoFetch
will only include the associations given. IfautoFetch
is set totrue
, then just fetch all associations. If it is an array, only fetch the ones specified.