Acts_as_api doesn't get the includes statement.
rnaud opened this issue · 3 comments
Hello,
In my rails views, whenever I need to call parent items for a collection, I use includes like so.
Photo.includes(:comments).page(3)
This way each time I iterate through my photos in the view it doesn't have to do a SELECT statement to get the comments of the photo.
Acts_as_api doesn't work with include apparently and makes SELECT call for every parent or child association.
I'll look it up.
I use acts_as_api myself in a similar way and using includes
works as expected - preventing N+1 queries.
At the moment I can't imagine how this could be even possible, because acts_as_api does not meant to influence the way the data is gathered by active record.
Could you provide some more information or maybe even a simple example?
My mistake, you are totally right, It's working as expected.
Good to hear :)