mirror of
https://github.com/discourse/discourse.git
synced 2025-03-21 08:45:41 +08:00
prevent N+1 when loading custom emojis
This commit is contained in:
parent
99527af38a
commit
c26ba890bd
@ -84,7 +84,7 @@ class Emoji
|
||||
def self.load_custom
|
||||
result = []
|
||||
|
||||
CustomEmoji.order(:name).all.each do |emoji|
|
||||
CustomEmoji.includes(:upload).order(:name).find_each do |emoji|
|
||||
result << Emoji.new.tap do |e|
|
||||
e.name = emoji.name
|
||||
e.url = emoji.upload&.url
|
||||
|
Loading…
x
Reference in New Issue
Block a user