ActiveRecord: can't use `pluck` after `where` clause with eager-loaded associations
I have an app that has a number of Post models, each of which belongs_to a User model. When these posts are published, a PublishedPost model is created that belongs_to the relevant Post model. I'm trying to build an ActiveRecord query to find published posts that match a user name, then get the ids of those published posts, but I'm getting an error when I try to use the pluck method after eager-loading my associations and searching them with the where method. Here's (part of) my controller: class PublishedPostsController < ApplicationController def index ar_query = PublishedPost.order(