Rails3: model: replace deprecated validate method at member model

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8047 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-12-03 14:33:49 +00:00
parent 3d1e6f5b96
commit 23fd43374d
1 changed files with 2 additions and 1 deletions

View File

@ -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