]> git.openstreetmap.org Git - rails.git/commitdiff
Only show changesets that are actually closed in the index view.
authorThomas Wood <grand.edgemaster@gmail.com>
Wed, 31 Dec 2008 16:14:39 +0000 (16:14 +0000)
committerThomas Wood <grand.edgemaster@gmail.com>
Wed, 31 Dec 2008 16:14:39 +0000 (16:14 +0000)
app/controllers/browse_controller.rb
test/functional/browse_controller_test.rb

index 2e4af03d878e79aae231212c2b1508916627e822..237c57ab232db987f1b385100f01acf91289263f 100644 (file)
@@ -8,7 +8,7 @@ class BrowseController < ApplicationController
   end
   
   def index
-    @changesets = Changeset.find(:all, :order => "closed_at DESC", :limit=> 20)
+    @changesets = Changeset.find(:all, :order => "closed_at DESC", :conditions => ['closed_at < ?', DateTime.now], :limit=> 20)
   end
   
   def relation 
index a36fa3703e85fbee3709e4904dd4d14a7f4aecc5..c4d7a5ae4d0ff4f6a9dc59fb9b75164ce8ee3751 100644 (file)
@@ -20,7 +20,7 @@ class BrowseControllerTest < ActionController::TestCase
   
   # This should display the last 20 changesets closed.
   def test_index
-    @changesets = Changeset.find(:all, :order => "closed_at DESC", :limit=> 20)
+    @changesets = Changeset.find(:all, :order => "closed_at DESC", :conditions => ['closed_at < ?', DateTime.now], :limit=> 20)
     assert @changesets.size <= 20
     get :index
     assert_response :success