From 6241a50c3165ed8ffba6edfc655ea1c3a23cf8b1 Mon Sep 17 00:00:00 2001 From: Type-kun Date: Mon, 19 Sep 2016 17:51:36 +0500 Subject: [PATCH] Fix #2628 along with similar bug for notes --- app/logical/post_query_builder.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/logical/post_query_builder.rb b/app/logical/post_query_builder.rb index 80e6a8f36..13fac8b59 100644 --- a/app/logical/post_query_builder.rb +++ b/app/logical/post_query_builder.rb @@ -254,28 +254,28 @@ class PostQueryBuilder if q[:commenter_ids] q[:commenter_ids].each do |commenter_id| - relation = relation.where("posts.id IN (?)", Comment.where("creator_id = ?", commenter_id).select("post_id").uniq) + relation = relation.where("posts.id IN (?)", Comment.unscoped.where("creator_id = ?", commenter_id).select("post_id").uniq) end has_constraints! end if q[:noter_ids] q[:noter_ids].each do |noter_id| - relation = relation.where("posts.id IN (?)", Note.where("creator_id = ?", noter_id).select("post_id").uniq) + relation = relation.where("posts.id IN (?)", Note.unscoped.where("creator_id = ?", noter_id).select("post_id").uniq) end has_constraints! end if q[:note_updater_ids] q[:note_updater_ids].each do |note_updater_id| - relation = relation.where("posts.id IN (?)", NoteVersion.where("updater_id = ?", note_updater_id).select("post_id").uniq) + relation = relation.where("posts.id IN (?)", NoteVersion.unscoped.where("updater_id = ?", note_updater_id).select("post_id").uniq) end has_constraints! end if q[:artcomm_ids] q[:artcomm_ids].each do |artcomm_id| - relation = relation.where("posts.id IN (?)", ArtistCommentaryVersion.where("updater_id = ?", artcomm_id).select("post_id").uniq) + relation = relation.where("posts.id IN (?)", ArtistCommentaryVersion.unscoped.where("updater_id = ?", artcomm_id).select("post_id").uniq) end has_constraints! end