diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-04-04 17:52:24 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-04-04 17:52:24 +0000 |
commit | f604fe946095350dccbb09a84962e94e10374d77 (patch) | |
tree | 583afd105ab32f0191403f2d59a1454792f25c95 | |
parent | 8fe94c30fe2a5044eda08d9bb73a2e5391273511 (diff) | |
download | redmine-f604fe946095350dccbb09a84962e94e10374d77.tar.gz redmine-f604fe946095350dccbb09a84962e94e10374d77.zip |
SQL Cleanup.
git-svn-id: http://svn.redmine.org/redmine/trunk@16479 e93f8b46-1217-0410-a6f0-8f06a7374b81
-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 a1f5156bf..b8ab4ea97 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 {joins(:project). - where("#{Project.table_name}.status<>#{Project::STATUS_ARCHIVED}")}, + lambda {joins(:project).where.not(:projects => {:status => Project::STATUS_ARCHIVED})}, :class_name => 'Member', :foreign_key => 'user_id' has_many :projects, :through => :memberships |