# Named\_scope with instance methods

**URL:** <https://www.ruby-forum.com/t/named-scope-with-instance-methods/157909>\
**Category:** Rails\
**Created:** [January 16, 2009, 2:05pm UTC](https://www.ruby-forum.com/t/named-scope-with-instance-methods/157909 "2009-01-16T14:05:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ab097/32.png) [@bartz](https://www.ruby-forum.com/u/bartz)\
**Post date:** [January 16, 2009, 2:05pm UTC](https://www.ruby-forum.com/t/named-scope-with-instance-methods/157909/1 "2009-01-16T14:05:54Z")

</div>

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!
