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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user