diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-01-07 11:40:09 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-01-07 11:40:09 +0000 |
commit | 3deb70d4aab992c00b5048630033d6614aea97c1 (patch) | |
tree | 6afa66b87956fafdc7a5f1f77c32094edcd27d5a /app/models/principal.rb | |
parent | 79c2e42889913a2f4ec583b4bbc9fbe256d92e7e (diff) | |
download | redmine-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/models/principal.rb')
-rw-r--r-- | app/models/principal.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/principal.rb b/app/models/principal.rb index 15cf69961..a1f5156bf 100644 --- a/app/models/principal.rb +++ b/app/models/principal.rb @@ -28,8 +28,7 @@ class Principal < ActiveRecord::Base has_many :members, :foreign_key => 'user_id', :dependent => :destroy has_many :memberships, - lambda {preload(:project, :roles). - joins(:project). + lambda {joins(:project). where("#{Project.table_name}.status<>#{Project::STATUS_ARCHIVED}")}, :class_name => 'Member', :foreign_key => 'user_id' |