PERF: Fix broken memoization in `GroupShowSerializer`.

This commit is contained in:
Guo Xiang Tan 2020-09-11 10:08:06 +08:00
parent 7fc70900d2
commit 468417a716
No known key found for this signature in database
GPG Key ID: FBD110179AAC1F20
1 changed files with 2 additions and 1 deletions

View File

@ -58,6 +58,7 @@ class GroupShowSerializer < BasicGroupSerializer
end end
def fetch_group_user def fetch_group_user
@group_user ||= object.group_users.find_by(user: scope.user) return @group_user if defined?(@group_user)
@group_user = object.group_users.find_by(user: scope.user)
end end
end end