##// END OF EJS Templates
code layout clean up app/models/news.rb...
Toshi MARUYAMA -
r8393:0bd651330b83
parent child
Show More
@@ -43,7 +43,10 class News < ActiveRecord::Base
43 43
44 44 # returns latest news for projects visible by user
45 45 def self.latest(user = User.current, count = 5)
46 find(:all, :limit => count, :conditions => Project.allowed_to_condition(user, :view_news), :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
46 find(:all, :limit => count,
47 :conditions => Project.allowed_to_condition(user, :view_news),
48 :include => [ :author, :project ],
49 :order => "#{News.table_name}.created_on DESC")
47 50 end
48 51
49 52 private
General Comments 0
You need to be logged in to leave comments. Login now