Merge branch '22681-avoid-empty-queries-on-reference-parsers' into 'master'
"Banzai::ReferenceParser::BaseParser is executing queries that don't return results" See merge request !6546
This commit is contained in:
commit
e8cce313a1
|
@ -5,6 +5,7 @@ v 8.13.0 (unreleased)
|
||||||
- Speed-up group milestones show page
|
- Speed-up group milestones show page
|
||||||
- Log LDAP lookup errors and don't swallow unrelated exceptions. !6103 (Markus Koller)
|
- Log LDAP lookup errors and don't swallow unrelated exceptions. !6103 (Markus Koller)
|
||||||
- Add more tests for calendar contribution (ClemMakesApps)
|
- Add more tests for calendar contribution (ClemMakesApps)
|
||||||
|
- Avoid database queries on Banzai::ReferenceParser::BaseParser for nodes without references
|
||||||
- Fix robots.txt disallowing access to groups starting with "s" (Matt Harrison)
|
- Fix robots.txt disallowing access to groups starting with "s" (Matt Harrison)
|
||||||
- Only update issuable labels if they have been changed
|
- Only update issuable labels if they have been changed
|
||||||
- Revoke button in Applications Settings underlines on hover.
|
- Revoke button in Applications Settings underlines on hover.
|
||||||
|
|
|
@ -79,8 +79,12 @@ module Banzai
|
||||||
def referenced_by(nodes)
|
def referenced_by(nodes)
|
||||||
ids = unique_attribute_values(nodes, self.class.data_attribute)
|
ids = unique_attribute_values(nodes, self.class.data_attribute)
|
||||||
|
|
||||||
|
if ids.empty?
|
||||||
|
references_relation.none
|
||||||
|
else
|
||||||
references_relation.where(id: ids)
|
references_relation.where(id: ids)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Returns the ActiveRecord::Relation to use for querying references in the
|
# Returns the ActiveRecord::Relation to use for querying references in the
|
||||||
# DB.
|
# DB.
|
||||||
|
|
Loading…
Reference in New Issue