summaryrefslogtreecommitdiffstats
path: root/app/models/principal.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-13 13:43:01 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-13 13:43:01 +0000
commitc93fccc84a939b14bd5d67d58514bd2ef58e4a08 (patch)
tree6b61e20a573584b35d0ce8de25f746e77658bdc4 /app/models/principal.rb
parentd46a0a3a4fd91108da013bd2d348a575d9f860d6 (diff)
downloadredmine-c93fccc84a939b14bd5d67d58514bd2ef58e4a08.tar.gz
redmine-c93fccc84a939b14bd5d67d58514bd2ef58e4a08.zip
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10994 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/principal.rb')
-rw-r--r--app/models/principal.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/principal.rb b/app/models/principal.rb
index 72cae3719..f6a91a471 100644
--- a/app/models/principal.rb
+++ b/app/models/principal.rb
@@ -30,7 +30,7 @@ class Principal < ActiveRecord::Base
has_many :issue_categories, :foreign_key => 'assigned_to_id', :dependent => :nullify
# Groups and active users
- scope :active, lambda { where("#{Principal.table_name}.status = 1") }
+ scope :active, lambda { where(:status => STATUS_ACTIVE) }
scope :like, lambda {|q|
q = q.to_s
@@ -57,7 +57,7 @@ class Principal < ActiveRecord::Base
where("1=0")
else
ids = projects.map(&:id)
- where("#{Principal.table_name}.status = 1 AND #{Principal.table_name}.id IN (SELECT DISTINCT user_id FROM #{Member.table_name} WHERE project_id IN (?))", ids)
+ active.where("#{Principal.table_name}.id IN (SELECT DISTINCT user_id FROM #{Member.table_name} WHERE project_id IN (?))", ids)
end
}
# Principals that are not members of projects