X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/16c3c533022d90cbfafecd17349d09fcbb7abed9..58e95f7ea46accda6359b187ce5936aad4ac5945:/app/controllers/diary_entries_controller.rb?ds=inline 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