code layout clean up app/models/news.rb

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8513 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2012-01-05 03:46:19 +00:00
parent a6a9670fe9
commit 0bd651330b
1 changed files with 4 additions and 1 deletions

View File

@ -43,7 +43,10 @@ class News < ActiveRecord::Base
# returns latest news for projects visible by user
def self.latest(user = User.current, count = 5)
find(:all, :limit => count, :conditions => Project.allowed_to_condition(user, :view_news), :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
find(:all, :limit => count,
:conditions => Project.allowed_to_condition(user, :view_news),
:include => [ :author, :project ],
:order => "#{News.table_name}.created_on DESC")
end
private