Skip to content

Commit

Permalink
Don't show projects created more than 30 days ago in "Latest projects…
Browse files Browse the repository at this point in the history
…" (#21148).

git-svn-id: http://svn.redmine.org/redmine/trunk@14854 e93f8b46-1217-0410-a6f0-8f06a7374b81
  • Loading branch information
jplang committed Nov 8, 2015
1 parent dff15dc commit 328e076
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ def identifier_frozen?
# 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.
Expand Down

0 comments on commit 328e076

Please sign in to comment.