我尝试获取除了那些所有视频与类别[20,21,22]Rails的where.not跳过一些记录
这是我的查询
@cc = Video.joins(:categories).where.not(categories: { id: [20,21,22]})
但是当我做@cc.find(113).categories
我得到这个
#<ActiveRecord::Associations::CollectionProxy
[#<Category id: 21, title: "music">, #<Category id: 22, title: "movies">,
#<Category id: 28, title: "collage">]>
我在做什么错?
见我的编辑... – Brozorec