diff options
author | Stan Hu <stanhu@gmail.com> | 2016-08-01 23:11:45 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-08-01 23:11:45 +0300 |
commit | 99c02ed53c994fbd71442410c78daf220c6d1ced (patch) | |
tree | 62ce3f5d605e086c366ed2d850e2c0832794dd71 /app/models | |
parent | aa727434d7619956c43c2d72d2edd8a3bd61f535 (diff) |
Only use RequestStore in ProjectTeam#max_member_access_for_user if it is active
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/project_team.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/project_team.rb b/app/models/project_team.rb index fdfaf052730..19fd082534c 100644 --- a/app/models/project_team.rb +++ b/app/models/project_team.rb @@ -138,8 +138,13 @@ class ProjectTeam def max_member_access_for_user_ids(user_ids) user_ids = user_ids.uniq key = "max_member_access:#{project.id}" - RequestStore.store[key] ||= {} - access = RequestStore.store[key] + + access = {} + + if RequestStore.active? + RequestStore.store[key] ||= {} + access = RequestStore.store[key] + end # Lookup only the IDs we need user_ids = user_ids - access.keys |