post_tags_match: replace joins with subqueries.

Refactor various post_tag_match methods to use subqueries instead of joins.

This simplifies things inside PostQueryBuilder, since now we can assume
we're always dealing with a Post relation, rather than some other table
joined with the posts table.
This commit is contained in:
evazion
2018-12-11 18:10:20 -06:00
parent cacc899a4d
commit 37b2214472
10 changed files with 14 additions and 15 deletions

View File

@@ -1662,7 +1662,7 @@ class Post < ApplicationRecord
if read_only
begin
PostQueryBuilder.new(query).build(PostReadOnly.where("true"))
PostQueryBuilder.new(query, read_only: true).build
rescue PG::ConnectionBad
PostQueryBuilder.new(query).build
end