diff --git a/app/models/principal.rb b/app/models/principal.rb index b6f41d535..9cb3b1b22 100644 --- a/app/models/principal.rb +++ b/app/models/principal.rb @@ -25,7 +25,11 @@ class Principal < ActiveRecord::Base 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 :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 :issue_categories, :foreign_key => 'assigned_to_id', :dependent => :nullify