1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-20 15:31:12 +00:00

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
This commit is contained in:
Jean-Philippe Lang 2015-11-08 21:31:18 +00:00
parent dff15dcc9a
commit 328e076722

View File

@ -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.