Rails3: model: replace deprecated validate method at member_role model

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8068 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-12-04 05:21:20 +00:00
parent 747afd8088
commit 1de2c1c2af
1 changed files with 2 additions and 1 deletions

View File

@ -25,8 +25,9 @@ class MemberRole < ActiveRecord::Base
after_destroy :remove_role_from_group_users
validates_presence_of :role
validate :validate_role_member
def validate
def validate_role_member
errors.add :role_id, :invalid if role && !role.member?
end