summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-08 10:44:42 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-08 10:44:42 +0000
commitdf0b91e2383811cf0987fc65d6bcb8b63541ab2d (patch)
tree255d4f4f6458bd372c44818474d9ebfc92703c3f
parent2ebcc6d9601f86334119bd17a8eb65851d374f84 (diff)
downloadredmine-df0b91e2383811cf0987fc65d6bcb8b63541ab2d.tar.gz
redmine-df0b91e2383811cf0987fc65d6bcb8b63541ab2d.zip
Moved user status constants to Principal model.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10958 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/principal.rb6
-rw-r--r--app/models/user.rb6
2 files changed, 6 insertions, 6 deletions
diff --git a/app/models/principal.rb b/app/models/principal.rb
index f467f847f..72cae3719 100644
--- a/app/models/principal.rb
+++ b/app/models/principal.rb
@@ -18,6 +18,12 @@
class Principal < ActiveRecord::Base
self.table_name = "#{table_name_prefix}users#{table_name_suffix}"
+ # Account statuses
+ STATUS_ANONYMOUS = 0
+ STATUS_ACTIVE = 1
+ STATUS_REGISTERED = 2
+ STATUS_LOCKED = 3
+
has_many :members, :foreign_key => 'user_id', :dependent => :destroy
has_many :memberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :project, :roles ], :conditions => "#{Project.table_name}.status<>#{Project::STATUS_ARCHIVED}", :order => "#{Project.table_name}.name"
has_many :projects, :through => :memberships
diff --git a/app/models/user.rb b/app/models/user.rb
index eed359fea..0c7fd7558 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -20,12 +20,6 @@ require "digest/sha1"
class User < Principal
include Redmine::SafeAttributes
- # Account statuses
- STATUS_ANONYMOUS = 0
- STATUS_ACTIVE = 1
- STATUS_REGISTERED = 2
- STATUS_LOCKED = 3
-
# Different ways of displaying/sorting users
USER_FORMATS = {
:firstname_lastname => {