【发布时间】:2012-05-08 14:42:39
【问题描述】:
我无法在 Mongoapper 中使用 OR 将这两个范围链接在一起:
scope :comment_is_nil, where(:comment => nil)
scope :post_not_blank, where(:post.ne => "")
它应该返回评论不为零的模型对象,或者帖子不为空。
这不起作用:
Model.where("$or" => [{:comment_is_nil, :post_not_blank])
有什么想法吗?
【问题讨论】:
标签: ruby mongodb model scope mongomapper