diff options
-rw-r--r-- | app/models/news.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/news.rb b/app/models/news.rb index 65a22c66f..19a55bda4 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -71,7 +71,7 @@ class News < ActiveRecord::Base # returns latest news for projects visible by user def self.latest(user = User.current, count = 5) - visible(user).joins([:author, :project]).order("#{News.table_name}.created_on DESC").limit(count).to_a + visible(user).preload(:author, :project).order("#{News.table_name}.created_on DESC").limit(count).to_a end private |