Moved user status constants to Principal model.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10958 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
2ebcc6d960
commit
df0b91e238
|
@ -18,6 +18,12 @@
|
||||||
class Principal < ActiveRecord::Base
|
class Principal < ActiveRecord::Base
|
||||||
self.table_name = "#{table_name_prefix}users#{table_name_suffix}"
|
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 :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 :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
|
has_many :projects, :through => :memberships
|
||||||
|
|
|
@ -20,12 +20,6 @@ require "digest/sha1"
|
||||||
class User < Principal
|
class User < Principal
|
||||||
include Redmine::SafeAttributes
|
include Redmine::SafeAttributes
|
||||||
|
|
||||||
# Account statuses
|
|
||||||
STATUS_ANONYMOUS = 0
|
|
||||||
STATUS_ACTIVE = 1
|
|
||||||
STATUS_REGISTERED = 2
|
|
||||||
STATUS_LOCKED = 3
|
|
||||||
|
|
||||||
# Different ways of displaying/sorting users
|
# Different ways of displaying/sorting users
|
||||||
USER_FORMATS = {
|
USER_FORMATS = {
|
||||||
:firstname_lastname => {
|
:firstname_lastname => {
|
||||||
|
|
Loading…
Reference in New Issue