allow forum posts to be searched by category (#1720)

This commit is contained in:
Toks
2013-06-13 23:07:19 -04:00
parent f653ea68ca
commit 05be9f41e7
2 changed files with 8 additions and 0 deletions

View File

@@ -56,6 +56,10 @@ class ForumPost < ActiveRecord::Base
q = q.creator_name(params[:creator_name].tr(" ", "_"))
end
if params[:topic_category_id].present?
q = q.joins(:topic).where("forum_topics.category_id = ?", params[:topic_category_id].to_i)
end
q
end
end