X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6b6345ecdba2589df96489b259651adb4c764362..58e95f7ea46accda6359b187ce5936aad4ac5945:/app/controllers/diary_entries_controller.rb diff --git a/app/controllers/diary_entries_controller.rb b/app/controllers/diary_entries_controller.rb index d4a32efb2..ba2a2976e 100644 --- a/app/controllers/diary_entries_controller.rb +++ b/app/controllers/diary_entries_controller.rb @@ -235,11 +235,12 @@ class DiaryEntriesController < ApplicationController end def comments + conditions = { :user_id => @user } + + conditions[:visible] = true unless current_user&.administrator? + @comment_pages, @comments = paginate(:diary_comments, - :conditions => { - :user_id => @user, - :visible => true - }, + :conditions => conditions, :order => "created_at DESC", :per_page => 20) @page = (params[:page] || 1).to_i