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
However, I would like to also eager load the Authors association to prevent n+1 queries, but it doesn't seem like this is possible.
I've tried PgSearch.multisearch(params['search']).includes(:searchable, :author).where(author_id: 2) but this gives a missing association error. Any suggestions?
The text was updated successfully, but these errors were encountered:
In the docs, you can eager load the searchable associations via
PgSearch.multisearch("Square").includes(:searchable)
.After adding additional attributes via migrations and configuration:
I now have the ability to do:
PgSearch.multisearch(params['search']).where(author_id: 2)
However, I would like to also eager load the Authors association to prevent n+1 queries, but it doesn't seem like this is possible.
I've tried
PgSearch.multisearch(params['search']).includes(:searchable, :author).where(author_id: 2)
but this gives a missing association error. Any suggestions?The text was updated successfully, but these errors were encountered: