summaryrefslogtreecommitdiffstats
path: root/app/controllers/users_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-07 11:40:09 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-07 11:40:09 +0000
commit3deb70d4aab992c00b5048630033d6614aea97c1 (patch)
tree6afa66b87956fafdc7a5f1f77c32094edcd27d5a /app/controllers/users_controller.rb
parent79c2e42889913a2f4ec583b4bbc9fbe256d92e7e (diff)
downloadredmine-3deb70d4aab992c00b5048630033d6614aea97c1.tar.gz
redmine-3deb70d4aab992c00b5048630033d6614aea97c1.zip
Don't preload projects and roles on Principal#memberships association (#23519).
Patch by Ondřej Ezr. git-svn-id: http://svn.redmine.org/redmine/trunk@16153 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r--app/controllers/users_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 3e4feb8a4..60600a252 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -69,7 +69,7 @@ class UsersController < ApplicationController
end
# show projects based on current user visibility
- @memberships = @user.memberships.where(Project.visible_condition(User.current)).to_a
+ @memberships = @user.memberships.preload(:roles, :project).where(Project.visible_condition(User.current)).to_a
respond_to do |format|
format.html {