From: Thomas Wood Date: Wed, 31 Dec 2008 16:14:39 +0000 (+0000) Subject: Only show changesets that are actually closed in the index view. X-Git-Tag: live~8182^2~79 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/8fe53e482332342dc3823dcde0717d34932bcb3c Only show changesets that are actually closed in the index view. --- diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index 2e4af03d8..237c57ab2 100644 --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@ -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 diff --git a/test/functional/browse_controller_test.rb b/test/functional/browse_controller_test.rb index a36fa3703..c4d7a5ae4 100644 --- a/test/functional/browse_controller_test.rb +++ b/test/functional/browse_controller_test.rb @@ -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