假设我有:
class ForumTopic < ActiveRecord::Base
has_many :forum_posts
named_scope :number_of_posts, ??????
end
class ForumPost < ActiveRecord::Base
belongs_to :forum_topic
end
我应该放什么??????允许 searchlogic 查询,例如:
ForumTopic.descend_by_number_of_posts
任何帮助将不胜感激!