【发布时间】:2015-02-17 18:48:31
【问题描述】:
scope :active_without_owner, -> { where(active: true, role: 'owner') }
返回角色设置为“所有者”的活动用户。
我无法弄清楚返回具有“所有者”以外角色的活动用户的语法。
我试过了
scope :active_without_owner, -> { where(active: true, not(role: 'owner')) }
还有许多其他组合...
【问题讨论】:
标签: ruby-on-rails scope