From c000b31ffb365241d3128800aacece7d8475f357 Mon Sep 17 00:00:00 2001
From: danielvincent <danielgrippi@gmail.com>
Date: Thu, 23 Sep 2010 10:17:13 -0700
Subject: [PATCH] query for post through user

---
 app/controllers/comments_controller.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb
index 4caeb14142..fe11cb8ae2 100644
--- a/app/controllers/comments_controller.rb
+++ b/app/controllers/comments_controller.rb
@@ -10,7 +10,7 @@ class CommentsController < ApplicationController
   respond_to :json, :only => :show
 
   def create
-    target = Post.find_by_id params[:comment][:post_id]
+    target = current_user.find_visible_post_by_id params[:comment][:post_id]
     text = params[:comment][:text]
 
     @comment = current_user.comment text, :on => target
-- 
GitLab