/comments.json: add id param; allow id and post_id to take lists of ids.

This commit is contained in:
evazion
2016-12-26 18:25:31 -06:00
parent 69c50290a8
commit 9347f27059

View File

@@ -69,8 +69,12 @@ class Comment < ActiveRecord::Base
q = q.body_matches(params[:body_matches])
end
if params[:id].present?
q = q.where("id in (?)", params[:id].split(",").map(&:to_i))
end
if params[:post_id].present?
q = q.where("post_id = ?", params[:post_id].to_i)
q = q.where("post_id in (?)", params[:post_id].split(",").map(&:to_i))
end
if params[:post_tags_match].present?