X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/c6592045c482d9086d5db6ebab87db49aa85cefa..bf29550db840c97cafffbe1e836750bef6c7942d:/app/controllers/diary_entry_controller.rb diff --git a/app/controllers/diary_entry_controller.rb b/app/controllers/diary_entry_controller.rb index a965af2ff..d9f5e4253 100644 --- a/app/controllers/diary_entry_controller.rb +++ b/app/controllers/diary_entry_controller.rb @@ -69,7 +69,8 @@ class DiaryEntryController < ApplicationController end else @title = "Users' diaries" - @entry_pages, @entries = paginate(:diary_entries, + @entry_pages, @entries = paginate(:diary_entries, :include => :user, + :conditions => "users.visible = 1", :order => 'created_at DESC', :per_page => 20) end @@ -90,7 +91,9 @@ class DiaryEntryController < ApplicationController render :nothing => true, :status => :not_found end else - @entries = DiaryEntry.find(:all, :order => 'created_at DESC', :limit => 20) + @entries = DiaryEntry.find(:all, :include => :user, + :conditions => "users.visible = 1", + :order => 'created_at DESC', :limit => 20) @title = "OpenStreetMap diary entries" @description = "Recent diary entries from users of OpenStreetMap" @link = "http://www.openstreetmap.org/diary"