diff --git a/app/logical/post_query_builder.rb b/app/logical/post_query_builder.rb index c2b5fdc7f..9ca5153c9 100644 --- a/app/logical/post_query_builder.rb +++ b/app/logical/post_query_builder.rb @@ -451,11 +451,11 @@ class PostQueryBuilder end q[:favgroups_neg].to_a.each do |favgroup| - relation = relation.where.not("posts.id": favgroup.post_ids) + relation = relation.where.not(id: FavoriteGroup.where(id: favgroup.id).select("unnest(post_ids)")) end q[:favgroups].to_a.each do |favgroup| - relation = relation.where("posts.id": favgroup.post_ids) + relation = relation.where(id: FavoriteGroup.where(id: favgroup.id).select("unnest(post_ids)")) end if q[:upvote].present?