<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Rails: Sorting a model by has_many associations</title>
	<atom:link href="http://blogs.gerbilsofwar.com/limi/2009/01/06/rails-sorting-a-model-by-has_many-associations/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gerbilsofwar.com/limi/2009/01/06/rails-sorting-a-model-by-has_many-associations/</link>
	<description>dabbling, frivolling, idling, loafing, loitering, playing and procrastinating</description>
	<lastBuildDate>Wed, 17 Mar 2010 19:29:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Chris Whamond</title>
		<link>http://blogs.gerbilsofwar.com/limi/2009/01/06/rails-sorting-a-model-by-has_many-associations/comment-page-1/#comment-4556</link>
		<dc:creator>Chris Whamond</dc:creator>
		<pubDate>Tue, 13 Oct 2009 19:20:22 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gerbilsofwar.com/limi/?p=203#comment-4556</guid>
		<description>How would a named_scope work in this example?

I have a Student model that has_many :attendances.

My Attendance model has a &quot;date&quot; attribute - the various days the student attended class.  

How would I sort my Students list so the student who has attended class most recently are at the top?  In other words with the most recent attendances.date?  How would I do this in a named_scope?  Thanks - nice site.

Chris</description>
		<content:encoded><![CDATA[<p>How would a named_scope work in this example?</p>
<p>I have a Student model that has_many :attendances.</p>
<p>My Attendance model has a &#8220;date&#8221; attribute &#8211; the various days the student attended class.  </p>
<p>How would I sort my Students list so the student who has attended class most recently are at the top?  In other words with the most recent attendances.date?  How would I do this in a named_scope?  Thanks &#8211; nice site.</p>
<p>Chris</p>
]]></content:encoded>
	</item>
</channel>
</rss>
