Named_scope with instance methods


#1

Hey all,

Imagine I’m writing a weblog with a RSS feeds. I only want the active
articles to be in the RSS feed. Articles have a fairly complex method to
define whether they active, which is pretty hard to convert to find
attributes. Besides, I already have defined that method…
So, is there a way to use instance methods in a named_scope? Something
like

named_scope :rss, :order => “created_at DESC”, :limit => 25, :if =>
Proc.new { |a| a.active? }

thanks!