published = Activity.all.eager_load([:podcast, :blog, :chat]).select('podcasts.draft = false')
我希望此代码能够输出所有不是草稿的播客,以及所有博客和聊天内容。相反,它会输出所有内容。
答案 0 :(得分:0)
如果要过滤未分组的记录,请使用where
:
published = Activity.where('podcasts.draft = false').eager_load([:podcast, :blog, :chat])