0
我在用戶模式下named_scope:命名範圍擴展 - 調用方法做外塊
named_scope :all_stars, :joins => [:all_stars] do
def overall
self.find(:all, :conditions => ['recordable_type = ?', 'User'])
end
end
我想這樣做:
named_scope :all_stars, :joins => [:all_stars] do
def overall
overall_all_stars_condition
end
end
def overall_all_stars_condition
self.find(:all, :conditions => ['recordable_type = ?', 'User'])
end
能不能做到?