如何找到所有没有添加taxons的大礼包?Spree找到没有任何taxons的产品
如果我运行Spree::Product.first.taxons
我得到ActiveRecord::Associations::CollectionProxy
与该产品的分类数组,但我将如何找到这个数组是空的所有产品?
我试图
Spree::Product.where(taxons: nil)
但这回
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR: column spree_products.taxon_id does not exist
这给了错误的ActiveRecord':: StatementInvalid:PG :: UndefinedTable:错误:缺少FROM子句条目表 “分类群”' – Qwertie
有没有所谓的分类单位的表? – Joe
发现问题,表是“spree_taxons”,所以'taxons.id IS NULL''必须是''spree_taxons.id IS NULL'' – Qwertie