diff options
-rw-r--r-- | app/models/member.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/member.rb b/app/models/member.rb index 0e15935c2..4206ba446 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -24,6 +24,7 @@ class Member < ActiveRecord::Base validates_presence_of :principal, :project validates_uniqueness_of :user_id, :scope => :project_id + validate :validate_role after_destroy :unwatch_from_permission_change @@ -81,7 +82,7 @@ class Member < ActiveRecord::Base protected - def validate + def validate_role errors.add_on_empty :role if member_roles.empty? && roles.empty? end |