Don't show deleted comments in a user's diary comment list
authorTom Hughes <tom@compton.nu>
Tue, 15 May 2012 17:58:13 +0000 (18:58 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 15 May 2012 17:58:13 +0000 (18:58 +0100)
app/controllers/diary_entry_controller.rb

index c45d369ac1832acedadb22be2954535e4f3c5eb0..68d3a81ee93485e89ce5f37204011aff10ac6a1c 100644 (file)
@@ -188,7 +188,10 @@ class DiaryEntryController < ApplicationController
 
   def comments
     @comment_pages, @comments = paginate(:diary_comments,
-                                         :conditions => { :user_id => @this_user },
+                                         :conditions => { 
+                                           :user_id => @this_user,
+                                           :visible => true
+                                         },
                                          :order => 'created_at DESC',
                                          :per_page => 20)
     @page = (params[:page] || 1).to_i