<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ruby On Rails Blog &#187; named_scope</title>
	<atom:link href="http://www.mendable.com/tag/named_scope/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mendable.com</link>
	<description>Mendable.com - Essential Reading for Ruby on Rails Developers</description>
	<lastBuildDate>Tue, 27 Jul 2010 19:38:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Understand Named_scope in 60 seconds</title>
		<link>http://www.mendable.com/understand-named_scope-in-60-seconds/</link>
		<comments>http://www.mendable.com/understand-named_scope-in-60-seconds/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 17:11:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[activerecord]]></category>
		<category><![CDATA[named_scope]]></category>

		<guid isPermaLink="false">http://www.mendable.com/?p=141</guid>
		<description><![CDATA[Named scope was introduced in Rails 2.x, it allows you to filter a selection of records easily and repeatedly, without having to write finder SQL all the time.

class Customer < ActiveRecord::Base
  has_many :carts
end

class Cart < ActiveRecord::Base
  belongs_to :customer
  named_scope :completed, :conditions => ["NOT ISNULL(completed_at)"]
end


Example of self-model scoping and finding:

# All completed carts [...]]]></description>
		<wfw:commentRss>http://www.mendable.com/understand-named_scope-in-60-seconds/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
