<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -39,11 +39,11 @@ class Dst
     tasks = if options.empty?
               Task.unfinished
             elsif context
-              Task.unfinished(:include =&gt; [:context, :project]).find_all { |task|
+              Task.unfinished.select { |task|
                 task.context.name == context if task.context
               }
             elsif project
-              Task.unfinished(:include =&gt; [:context, :project]).find_all { |task|
+              Task.unfinished.select { |task|
                 task.project.name == project if task.project
               }
             end || []</diff>
      <filename>lib/dst.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@ class Dst
       belongs_to :project
 
       def self.unfinished(options={})
-        find(:all, {:conditions =&gt; 'status = &quot;f&quot;'}.merge(options))
+        find(:all, :conditions =&gt; 'status = &quot;f&quot;', :include =&gt; [:context, :project], :order =&gt; 't1_r1')
       end
 
       def self.toggle!(task_id)</diff>
      <filename>lib/dst/models.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,6 @@
 $:.unshift 'lib/', File.dirname(__FILE__) + '/../lib'
+require 'rubygems'
+require 'spec'
 require 'dst'
 
 describe Dst do
@@ -140,25 +142,25 @@ describe Dst do
 
   describe &quot;when listing tasks: `[&lt;@context&gt; &lt;@project&gt;] [-a]]'&quot; do
     before(:each) do
-      @tasks = mock('tasks', :find_all =&gt; [@task], :empty? =&gt; false, :map =&gt; [@task])
+      @tasks = mock('tasks', :select =&gt; [@task], :empty? =&gt; false, :map =&gt; [@task])
       @task_model.stub!(:unfinished).and_return(@tasks)
     end
 
     it 'finds all unfinished tasks if no filter provided' do
       @task_model.should_receive(:unfinished).and_return(@tasks)
-      @tasks.should_not_receive(:find_all)
+      @tasks.should_not_receive(:select)
       @dst.process_command('')
     end
 
     it 'finds unfinished tasks filtered by context' do
       @task_model.should_receive(:unfinished).and_return(@tasks)
-      @tasks.should_receive(:find_all)
+      @tasks.should_receive(:select)
       @dst.process_command('@context')
     end
 
     it 'finds unfinished tasks filtered by project' do
       @task_model.should_receive(:unfinished).and_return(@tasks)
-      @tasks.should_receive(:find_all)
+      @tasks.should_receive(:select)
       @dst.process_command(':project')
     end
     </diff>
      <filename>spec/dst_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2acb0615a89bbcfb7a0a876ce867470dd994c9e5</id>
    </parent>
  </parents>
  <author>
    <name>Simon Rozet</name>
    <email>simon@rozet.name</email>
  </author>
  <url>http://github.com/sr/dst/commit/8af7c137e9e68645cba27619dd4f3d0c65ea3ceb</url>
  <id>8af7c137e9e68645cba27619dd4f3d0c65ea3ceb</id>
  <committed-date>2008-02-10T04:59:46-08:00</committed-date>
  <authored-date>2008-02-10T04:59:46-08:00</authored-date>
  <message>- Sort tasks by context
- Use #select instead #find_all
- Always pass include :context and :project when selecting tasks</message>
  <tree>95a36a4b35f0683d8cb3d1379cdcbce23674883a</tree>
  <committer>
    <name>Simon Rozet</name>
    <email>simon@rozet.name</email>
  </committer>
</commit>
