h[project_id] = memberships.where(:project_id => project_id)[0]

This commit is contained in:
Nigel 2019-08-27 22:10:21 +08:00
parent 253d2523d8
commit 0e8e39ee8c
1 changed files with 2 additions and 1 deletions

View File

@ -830,7 +830,8 @@ class User < Principal
project_id = project.is_a?(Project) ? project.id : project
@membership_by_project_id ||= Hash.new {|h, project_id|
h[project_id] = memberships.where(:project_id => project_id).first
# h[project_id] = memberships.where(:project_id => project_id).first
h[project_id] = memberships.where(:project_id => project_id)[0]
}
@membership_by_project_id[project_id]
end