1 ruby-on-rails acts-as-taggable-on
查找没有标签的条目的正确方法是什么?
我尝试使用,Entry.tagged_with(nil)但它只是返回一个空哈希。
我需要它,所以我可以列出仍需要标记的条目。
谢谢。
以下内容似乎对我有用:
Entry.includes("taggings").where("taggings.id is null")
Run Code Online (Sandbox Code Playgroud)
这也应该支持链接。例如,以下应该工作:
Entry.includes("taggings").where("taggings.id is null").where(foo: "bar")
Run Code Online (Sandbox Code Playgroud)