title: How to add order by in select query in rails 2.1.1
body: <p>How can I add <code>order by birthdate desc</code> to the following query? </p>
  
  <pre><code>User have friends 
  User have profile
  
     now = Date.today
     end = now + 7.days
  
  u= User.find(id)
  @somevariable = u.friends.select{|f|
        date = f.profile.birthdate if f.profile
        selected = false
        if date
   if (now.month == date.month) &amp;&amp; (date.day &gt;= now.day &amp;&amp; date.day &lt;= end_day.day )
            selected =true
          elsif (end.month == date.month) &amp;&amp; (date.day &lt;= end.day &amp;&amp; end_day.month != today.month)
            selected = true
          else
            selected=false
          end
         end
        selected }
  </code></pre>
  
  <p>Everything is working fine, except I need to order the results by <code>birthdate</code>.</p>