From 3d7ebd0108e245b9deac144f8572600892176e6e Mon Sep 17 00:00:00 2001 From: Toks Date: Tue, 2 Apr 2013 20:34:41 -0400 Subject: [PATCH] adds post_id search to comments --- app/models/comment.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/comment.rb b/app/models/comment.rb index defc95abf..a435e537d 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -49,6 +49,10 @@ class Comment < ActiveRecord::Base q = q.body_matches(params[:body_matches]) end + if params[:post_id].present? + q = q.where("post_id = ?", params[:post_id].to_i) + end + if params[:post_tags_match].present? q = q.post_tags_match(params[:post_tags_match]) end