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

This commit is contained in:
Tarek Khalil 2019-03-14 12:10:53 +00:00 committed by GitHub
parent fc0cf3ecd1
commit 6f6dea87f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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?