about summary refs log tree commit diff
path: root/app/lib/inline_renderer.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-11-06 18:49:46 +0100
committerGitHub <noreply@github.com>2022-11-06 18:49:46 +0100
commit54101563bbadbfafd9291a867d7fbea6df3a8b7b (patch)
treefcf9a125f6ebc3ad4182fa0edcbd7101b33aebb0 /app/lib/inline_renderer.rb
parent2f8fb49d1314db931385089bc9004a48700161ad (diff)
parent21d6bc16893a9dd24c5ef54cf2f554846c8eca5b (diff)
Merge pull request #1892 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/lib/inline_renderer.rb')
-rw-r--r--app/lib/inline_renderer.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/lib/inline_renderer.rb b/app/lib/inline_renderer.rb
index b70814748..4bb240b48 100644
--- a/app/lib/inline_renderer.rb
+++ b/app/lib/inline_renderer.rb
@@ -11,6 +11,7 @@ class InlineRenderer
     case @template
     when :status
       serializer = REST::StatusSerializer
+      preload_associations_for_status
     when :notification
       serializer = REST::NotificationSerializer
     when :conversation
@@ -35,6 +36,16 @@ class InlineRenderer
 
   private
 
+  def preload_associations_for_status
+    ActiveRecord::Associations::Preloader.new.preload(@object, {
+      active_mentions: :account,
+
+      reblog: {
+        active_mentions: :account,
+      },
+    })
+  end
+
   def current_user
     @current_account&.user
   end