From 328e0767228bbd1200bb33134fee82c97a28255b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 8 Nov 2015 21:31:18 +0000 Subject: [PATCH] Don't show projects created more than 30 days ago in "Latest projects" (#21148). git-svn-id: http://svn.redmine.org/redmine/trunk@14854 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/project.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/project.rb b/app/models/project.rb index 323a70632..9868e0444 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -149,7 +149,10 @@ class Project < ActiveRecord::Base # returns latest created projects # non public projects will be returned only if user is a member of those def self.latest(user=nil, count=5) - visible(user).limit(count).order("created_on DESC").to_a + visible(user).limit(count). + order(:created_on => :desc). + where("#{table_name}.created_on >= ?", 30.days.ago). + to_a end # Returns true if the project is visible to +user+ or to the current user. -- 2.39.5