From 8b61bb1c3e08e34e381b64eac88f2f6a6fb98680 Mon Sep 17 00:00:00 2001 From: niwatori24 <62463593+niwatori24@users.noreply.github.com> Date: Sun, 9 Aug 2020 22:23:42 +0900 Subject: Cache result of SQL (#14534) --- app/models/form/custom_emoji_batch.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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! -- cgit