From: niwatori24 <62463593+niwatori24@users.noreply.github.com> Date: Sun, 9 Aug 2020 13:23:42 +0000 (+0900) Subject: Cache result of SQL (#14534) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=8b61bb1c3e08e34e381b64eac88f2f6a6fb98680;p=mastodon.git Cache result of SQL (#14534) --- diff --git a/app/models/form/custom_emoji_batch.rb b/app/models/form/custom_emoji_batch.rb index 6b7ea5355..f4fa84c10 100644 --- a/app/models/form/custom_emoji_batch.rb +++ b/app/models/form/custom_emoji_batch.rb @@ -30,7 +30,7 @@ class Form::CustomEmojiBatch private def custom_emojis - CustomEmoji.where(id: custom_emoji_ids) + @custom_emojis ||= CustomEmoji.where(id: custom_emoji_ids) end def update!