@@ -149,7 +149,10 class Project < ActiveRecord::Base | |||
|
149 | 149 | # returns latest created projects |
|
150 | 150 | # non public projects will be returned only if user is a member of those |
|
151 | 151 | def self.latest(user=nil, count=5) |
|
152 |
visible(user).limit(count). |
|
|
152 | visible(user).limit(count). | |
|
153 | order(:created_on => :desc). | |
|
154 | where("#{table_name}.created_on >= ?", 30.days.ago). | |
|
155 | to_a | |
|
153 | 156 | end |
|
154 | 157 | |
|
155 | 158 | # Returns true if the project is visible to +user+ or to the current user. |
General Comments 0
You need to be logged in to leave comments.
Login now