post query builder: fix incompatibilities with Rails 6.1.
* Rename the `#negate` and `#and` methods that we monkey patch into ActiveRecord::Relation. These methods are now defined in Rails 6.1, but they shadow our methods and have slightly different behavior. * Fix a call to `invert`. It no longer accepts an argument.
This commit is contained in:
@@ -92,8 +92,8 @@ class PostQueryBuilder
|
||||
def metatags_match(metatags, relation)
|
||||
metatags.each do |metatag|
|
||||
clause = metatag_matches(metatag.name, metatag.value, quoted: metatag.quoted)
|
||||
clause = clause.negate if metatag.negated
|
||||
relation = relation.and(clause)
|
||||
clause = clause.negate_relation if metatag.negated
|
||||
relation = relation.and_relation(clause)
|
||||
end
|
||||
|
||||
relation
|
||||
|
||||
Reference in New Issue
Block a user