В моей модели User есть следующий 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
Можно ли это сделать?