I have a model called Author. An author has many Articles. Articles have a scope called .published that does: where(published: true).
I want to load the author, with the
Try this code:
Author .includes(:articles).where(published: true).references(:articles) .find(params[:author_id])
Here you can find more information about the example above: includes api doc