[英]How to perform a NOT query with postgres_ext
Is it possible to perform a NOT type query with chained methods using postgres_ext? 是否可以使用postgres_ext对链接方法执行NOT类型查询?
rules = Rule.where.overlap(:tags => ["foo"])
Basically want the inverse of the above. 基本上要上面的反面。 Thanks!
谢谢!
In regular active record you can use .where.not
as described in this article: https://robots.thoughtbot.com/activerecords-wherenot however looking through the source code of postgres_ext I don't know if it is defined in that library. 在常规活动记录中,您可以使用
.where.not
,如本文中所述: https : .where.not
,但是查看postgres_ext的源代码,我不知道它是否在该库中定义。 You may be able to construct your query in a way that uses the native active record methods. 您可能可以使用本机活动记录方法来构造查询。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.