【发布时间】:2011-06-19 06:15:22
【问题描述】:
有没有办法把几个named_scope组合起来,但把它们用作OR逻辑?
named_scope :a, { :conditions => ["posts.type_post == #{PERSONAL}"] }
named_scope :b, { :conditions => ["posts.type_post == #{PUBLIC}"] }
有没有办法使用这些 a 和 b 让我得到 posts.type_post == PERSONAL 或 posts.type_post == PUBLIC ?
谢谢
【问题讨论】:
标签: ruby-on-rails scope named-scope