Project

General

Profile

Defect #8932 » principal_acts_as_customizable.patch

Thomas Löber, 2011-08-05 13:11

View differences:

app/models/group.rb (Arbeitskopie)
19 19
  has_and_belongs_to_many :users, :after_add => :user_added,
20 20
                                  :after_remove => :user_removed
21 21
  
22
  acts_as_customizable
23
  
24 22
  validates_presence_of :lastname
25 23
  validates_uniqueness_of :lastname, :case_sensitive => false
26 24
  validates_length_of :lastname, :maximum => 30
app/models/principal.rb (Arbeitskopie)
23 23
  has_many :projects, :through => :memberships
24 24
  has_many :issue_categories, :foreign_key => 'assigned_to_id', :dependent => :nullify
25 25

  
26
  acts_as_customizable
27
  
26 28
  # Groups and active users
27 29
  named_scope :active, :conditions => "#{Principal.table_name}.type='Group' OR (#{Principal.table_name}.type='User' AND #{Principal.table_name}.status = 1)"
28 30
  
app/models/user.rb (Arbeitskopie)
54 54
  # Active non-anonymous users scope
55 55
  named_scope :active, :conditions => "#{User.table_name}.status = #{STATUS_ACTIVE}"
56 56
  
57
  acts_as_customizable
58
  
59 57
  attr_accessor :password, :password_confirmation
60 58
  attr_accessor :last_before_login_on
61 59
  # Prevents unauthorized assignments
    (1-1/1)