mirror of
https://github.com/discourse/discourse.git
synced 2025-03-04 05:44:09 +08:00
Avoid DB query when there are no mentions.
This commit is contained in:
parent
a57baeec2a
commit
4752ddc908
@ -456,6 +456,8 @@ module PrettyText
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.lookup_mentions(names, user_id: nil)
|
def self.lookup_mentions(names, user_id: nil)
|
||||||
|
return {} if names.blank?
|
||||||
|
|
||||||
sql = <<~SQL
|
sql = <<~SQL
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user