/comments.json: add id param; allow id and post_id to take lists of ids.
This commit is contained in:
@@ -69,8 +69,12 @@ class Comment < ActiveRecord::Base
|
|||||||
q = q.body_matches(params[:body_matches])
|
q = q.body_matches(params[:body_matches])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if params[:id].present?
|
||||||
|
q = q.where("id in (?)", params[:id].split(",").map(&:to_i))
|
||||||
|
end
|
||||||
|
|
||||||
if params[:post_id].present?
|
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
|
end
|
||||||
|
|
||||||
if params[:post_tags_match].present?
|
if params[:post_tags_match].present?
|
||||||
|
|||||||
Reference in New Issue
Block a user