about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorniwatori24 <62463593+niwatori24@users.noreply.github.com>2020-08-09 22:23:42 +0900
committerGitHub <noreply@github.com>2020-08-09 15:23:42 +0200
commit8b61bb1c3e08e34e381b64eac88f2f6a6fb98680 (patch)
tree8c710571d67e4bde4f33a0bf27a57d8495b853d1 /app/models
parentbd3420b1398c4c4ab2e2f2850b6dd6eaff0d361b (diff)
Cache result of SQL (#14534)
Diffstat (limited to 'app/models')
-rw-r--r--app/models/form/custom_emoji_batch.rb2
1 files changed, 1 insertions, 1 deletions
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!