0
我们在rails 3.0中使用的一些非常方便的范围是可重用性。让我们看一个例子。rails 3.1中的范围关联
class Wheel < AR::B
belongs_to :car
scope :deflated, where (:deflated => true)
end
class Car < AR::B
has_many :wheels
scope :out_of_service, joins(:wheels) & Wheel.deflated
end
但它似乎没有在3.1中工作,你知道是否有一种新的方式来做到这一点? 谢谢