@@ -56,7 +56,7 class News < ActiveRecord::Base | |||
|
56 | 56 | |
|
57 | 57 | # returns latest news for projects visible by user |
|
58 | 58 | def self.latest(user = User.current, count = 5) |
|
59 |
visible(user).includes([:author, :project]).order("#{News.table_name}.created_on DESC").limit(count) |
|
|
59 | visible(user).includes([:author, :project]).order("#{News.table_name}.created_on DESC").limit(count) | |
|
60 | 60 | end |
|
61 | 61 | |
|
62 | 62 | private |
General Comments 0
You need to be logged in to leave comments.
Login now