PERF: Make use of existing index.

This commit is contained in:
Guo Xiang Tan 2016-11-25 11:13:51 +08:00
parent 63a88ee6e7
commit fbc3fcc4af
1 changed files with 1 additions and 1 deletions

View File

@ -46,6 +46,6 @@ class BasicGroupSerializer < ApplicationSerializer
private
def fetch_group_user
@group_user ||= (object.group_users & scope.user.group_users).first
@group_user ||= object.group_users.find_by(user_id: scope.user.id)
end
end