]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/diary_entries_controller.rb
Merge remote-tracking branch 'upstream/pull/2354'
[rails.git] / app / controllers / diary_entries_controller.rb
index d4a32efb212c8b9cfbf45e0b88a5ae0b80276fa6..ba2a2976e324abcf36f8ce08c3ce079851a4a738 100644 (file)
@@ -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