FIX: optimise querying Post's serializer ignored attribute (#7169)

approved

#1

FIX: optimise querying Post’s serializer ignored attribute (#7169)

diff --git a/app/serializers/basic_post_serializer.rb b/app/serializers/basic_post_serializer.rb
index 014421d..5f116c2 100644
--- a/app/serializers/basic_post_serializer.rb
+++ b/app/serializers/basic_post_serializer.rb
@@ -45,7 +45,7 @@ class BasicPostSerializer < ApplicationSerializer
 
   def ignored
     object.is_first_post? && IgnoredUser.where(user_id: scope.current_user&.id,
-                                               ignored_user_id: object.user_id).present?
+                                               ignored_user_id: object.user_id).exists?
   end
 
   def include_name?

GitHub sha: 6f6dea87


Approved #2